Skip to content

Commit ede456e

Browse files
committed
feat: storefront with checkout
1 parent 5beca8e commit ede456e

67 files changed

Lines changed: 3297 additions & 1581 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/web-app/app/components/Navigation.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,10 +80,9 @@ const menuItems = computed(() => [
8080
const linkItems = computed(() => [
8181
{
8282
label: 'Новое меню',
83-
to: '/storefront',
83+
to: 'https://orderdemo.online',
8484
target: '_blank',
8585
icon: 'i-lucide-flask-conical',
86-
active: route.path.startsWith('/storefront'),
8786
},
8887
{
8988
label: 'Все задачи',

apps/web-app/app/components/storefront/Navigation.vue

Lines changed: 0 additions & 87 deletions
This file was deleted.

apps/web-app/app/pages/sign-in.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
<div class="w-full h-screen mx-auto grid grid-cols-1 lg:grid-cols-2">
33
<div class="hidden lg:block bg-[#54b948]">
44
<img
5-
src="/sushi-heart.svg"
5+
src="/sushi-heart-light.png"
66
alt=""
7-
class="w-2/3 opacity-10 brightness-[1000] absolute bottom-0 left-0 motion-preset-pulse motion-duration-4000"
7+
class="w-2/3 max-w-4xl opacity-10 fixed bottom-0 left-0 motion-preset-pulse motion-duration-4000"
88
>
99
</div>
1010

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
import { repository } from '@sushi-atrium/database'
22

33
export default defineEventHandler(async () => {
4-
try {
5-
return repository.product.list()
6-
} catch (error) {
7-
throw errorResolver(error)
8-
}
4+
return repository.product.list()
95
})

apps/web-app/server/utils/avatar.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -136,26 +136,26 @@ interface Options {
136136
headContrastColor?: string[]
137137
}
138138

139-
type PossibleEmotion =
140-
| 'rage'
141-
| 'veryAngry'
142-
| 'solemn'
143-
| 'tired'
144-
| 'serious'
145-
| 'eyesClosed'
146-
| 'smile'
147-
| 'calm'
148-
| 'eatingHappy'
149-
| 'lovingGrin1'
139+
type PossibleEmotion
140+
= | 'rage'
141+
| 'veryAngry'
142+
| 'solemn'
143+
| 'tired'
144+
| 'serious'
145+
| 'eyesClosed'
146+
| 'smile'
147+
| 'calm'
148+
| 'eatingHappy'
149+
| 'lovingGrin1'
150150

151-
type PossibleAccessories =
152-
| 'glasses'
153-
| 'glasses2'
154-
| 'glasses3'
155-
| 'glasses4'
156-
| 'glasses5'
157-
| 'sunglasses'
158-
| 'sunglasses2'
151+
type PossibleAccessories
152+
= | 'glasses'
153+
| 'glasses2'
154+
| 'glasses3'
155+
| 'glasses4'
156+
| 'glasses5'
157+
| 'sunglasses'
158+
| 'sunglasses2'
159159

160160
export interface AvatarParams {
161161
gender?: Gender

apps/web-storefront/.env.example

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Session password for Nuxt Auth Utils
2+
NUXT_SESSION_PASSWORD=""
3+
4+
# Main database
5+
DATABASE_URL=""
6+
7+
# URL to media server (probably s3 bucket with static URL)
8+
NUXT_PUBLIC_MEDIA_URL=""
9+
10+
# App version
11+
VERSION=""
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
export default defineAppConfig({
2+
ui: {
3+
button: {
4+
slots: {
5+
base: 'font-semibold',
6+
},
7+
variants: {
8+
size: {
9+
xl: {
10+
base: 'px-4 py-3 font-semibold',
11+
},
12+
},
13+
variant: {
14+
gradient: 'text-white bg-linear-to-br from-secondary-400 to-secondary-500 hover:opacity-90 aria-disabled:from-neutral-400 aria-disabled:to-neutral-500 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary',
15+
},
16+
color: {
17+
secondary: '!text-white disabled:!bg-inverted/50',
18+
},
19+
},
20+
},
21+
tabs: {
22+
variants: {
23+
variant: {
24+
pill: {
25+
trigger: 'data-[state=active]:!text-white',
26+
},
27+
gradient: {
28+
list: 'bg-elevated rounded-lg',
29+
trigger: 'data-[state=active]:bg-linear-to-br from-secondary-400 to-secondary-500 data-[state=active]:text-white data-[state=active]:font-semibold flex-1 w-full',
30+
indicator: 'rounded-md shadow-xs',
31+
},
32+
},
33+
},
34+
},
35+
modal: {
36+
slots: {
37+
content: 'divide-y-0',
38+
header: 'pb-0 min-h-12',
39+
title: 'text-xl/5 font-semibold',
40+
},
41+
},
42+
navigationMenu: {
43+
slots: {
44+
link: 'text-sm',
45+
},
46+
},
47+
toast: {
48+
slots: {
49+
title: 'text-lg/6',
50+
description: 'leading-4',
51+
icon: 'shrink-0 size-7',
52+
},
53+
},
54+
},
55+
})

apps/web-storefront/app/app.vue

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
<template>
2+
<UApp
3+
:locale="locales[locale]"
4+
:tooltip="{ delayDuration: 0 }"
5+
class="min-h-svh"
6+
>
7+
<NuxtLoadingIndicator :color="false" class="bg-primary h-[2px]" />
8+
<NuxtLayout>
9+
<NuxtPage />
10+
</NuxtLayout>
11+
</UApp>
12+
</template>
13+
14+
<script setup lang="ts">
15+
import * as locales from '@nuxt/ui/locale'
16+
17+
const { locale } = useI18n()
18+
19+
const lang = computed(() => locales[locale.value].code)
20+
const dir = computed(() => locales[locale.value].dir)
21+
22+
useHead({
23+
htmlAttrs: {
24+
lang,
25+
dir,
26+
},
27+
})
28+
29+
// Init Stores
30+
const menu = useMenuStore()
31+
const checkout = useCheckoutStore()
32+
33+
await Promise.all([
34+
menu.update(),
35+
checkout.update(),
36+
])
37+
</script>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
h1, h2, h3, h4, h5, h6 {
2+
font-family: var(--font-headers);
3+
}

apps/web-app/app/components/storefront/CatalogBreadcrumb.vue renamed to apps/web-storefront/app/components/CatalogBreadcrumb.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
icon="i-lucide-undo-2"
1414
class="w-full md:w-auto mx-auto md:mx-0 justify-center"
1515
:label="$t('common.return')"
16-
@click="back()"
16+
@click="router.back()"
1717
/>
1818
</div>
1919
</template>
@@ -23,5 +23,5 @@ defineProps<{
2323
items: { label: string, icon?: string, to?: string }[]
2424
}>()
2525
26-
const { back } = useRouter()
26+
const router = useRouter()
2727
</script>

0 commit comments

Comments
 (0)