Skip to content

Commit d2bc6b2

Browse files
authored
feat: flow item view (#153)
* feat: flow item view * fix: rollup
1 parent 612b235 commit d2bc6b2

22 files changed

Lines changed: 700 additions & 1345 deletions

File tree

apps/atrium-telegram/app/components/EpicCard.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<ActiveCard>
33
<UIcon name="i-lucide-crown" class="size-8 text-primary" />
44

5-
<h3 class="text-lg/5 font-bold">
5+
<h3 class="text-xl/5 font-bold">
66
{{ epic.title }}
77
</h3>
88

9-
<div class="w-full text-sm/4 text-muted font-normal whitespace-pre-wrap break-words line-clamp-4">
9+
<div class="w-full text-base/5 font-normal whitespace-pre-wrap break-words line-clamp-5">
1010
{{ epic.description }}
1111
</div>
1212

apps/atrium-telegram/app/components/Navigation.vue

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,20 @@
11
<template>
2-
<div class="z-50 touch-pan-x sticky inset-0 h-24">
2+
<div class="z-50 touch-pan-x sticky inset-0 h-38">
3+
<div class="w-full h-14 px-4 py-0 flex flex-row flex-nowrap gap-0 items-start justify-center transition-all duration-200 ease-in-out">
4+
<UButton
5+
v-if="isMainPage"
6+
variant="solid"
7+
color="secondary"
8+
size="xl"
9+
class="transition-all duration-200 ease-in-out motion-preset-slide-down motion-duration-200"
10+
icon="i-lucide-plus"
11+
:ui="{
12+
base: 'size-12 font-bold rounded-full',
13+
leadingIcon: 'size-6 mx-auto',
14+
}"
15+
/>
16+
</div>
17+
318
<nav
419
v-if="isNavigationShown"
520
class="w-full h-24 tg-bg-bottom-bar border-t border-default rounded-t-lg motion-preset-slide-up"
@@ -16,5 +31,5 @@
1631
</template>
1732

1833
<script setup lang="ts">
19-
const { isNavigationShown, mainRoutes } = useNavigation()
34+
const { isNavigationShown, mainRoutes, isMainPage } = useNavigation()
2035
</script>

apps/atrium-telegram/app/components/NavigationButton.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
<UChip
2323
v-else
2424
size="3xl"
25-
:show="!!route.badge"
25+
color="error"
26+
:show="!!route.badge && route.badge !== '0'"
2627
:text="route.badge"
2728
:ui="{
2829
base: '-right-1 px-1.5 py-2 ring-2 tg-text-button font-bold motion-translate-y-loop-25 motion-duration-3500',

apps/atrium-telegram/app/components/flow/FeedbackAverage.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
<UIcon name="i-lucide-users-round" class="size-8 text-primary" />
66

77
<div class="flex flex-row items-end gap-1 font-bold">
8-
<h3 class="text-3xl/5">
8+
<h3 class="text-2xl/5 font-bold">
99
{{ averageFeedback }}
1010
</h3>
11-
<p class="text-xl/4">
11+
<p class="text-lg/4">
1212
из 5
1313
</p>
1414
</div>

apps/atrium-telegram/app/components/flow/ItemCard.vue

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,20 @@
11
<template>
22
<ActiveCard>
3-
<UIcon name="i-lucide-clipboard-check" class="size-8 text-primary" />
3+
<div class="flex flex-row gap-2 items-center">
4+
<UIcon name="i-lucide-clipboard-check" class="size-8 text-primary" />
45

5-
<h3 class="text-2xl/5 font-bold">
6+
<div v-if="!isViewed" class="flex flex-row items-center gap-1.5 text-error">
7+
<UIcon
8+
name="i-lucide-pointer"
9+
class="size-8 motion-translate-y-loop-25 motion-preset-seesaw motion-duration-2000"
10+
/>
11+
<p class="max-w-22 text-sm/4 font-bold">
12+
Не просмотрено
13+
</p>
14+
</div>
15+
</div>
16+
17+
<h3 class="text-xl/5 font-bold">
618
{{ item.title }}
719
</h3>
820

@@ -31,7 +43,10 @@
3143
import { format } from 'date-fns'
3244
import { ru } from 'date-fns/locale/ru'
3345
34-
defineProps<{
46+
const { item } = defineProps<{
3547
item: FlowItemWithData
3648
}>()
49+
50+
const userStore = useUserStore()
51+
const isViewed = computed(() => item.views.some((view) => view.userId === userStore?.id))
3752
</script>

apps/atrium-telegram/app/components/flow/KitchensOnline.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
>
1111
<UIcon name="i-lucide-store" class="size-8 text-primary" />
1212
</UChip>
13-
<h3 class="text-3xl/5 font-bold">
13+
<h3 class="text-2xl/5 font-bold">
1414
{{ kitchensOnline }}
1515
</h3>
1616
</div>

apps/atrium-telegram/app/components/flow/OrderAmountAverage.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
<div class="flex flex-row gap-2 items-center">
55
<UIcon name="i-lucide-receipt-text" class="size-8 text-primary" />
66
<div class="flex flex-row items-end gap-1 font-bold">
7-
<h3 class="text-3xl/5">
7+
<h3 class="text-2xl/5 font-bold">
88
{{ averageToday }}
99
</h3>
10-
<p class="text-xl/4">
10+
<p class="text-lg/4">
1111
1212
</p>
1313
</div>

apps/atrium-telegram/app/components/flow/OrdersOnline.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="flex flex-col gap-2">
44
<div class="flex flex-row gap-2 items-center">
55
<UIcon name="i-lucide-shopping-bag" class="size-8 text-primary" />
6-
<h3 class="text-3xl/5 font-bold">
6+
<h3 class="text-2xl/5 font-bold">
77
{{ kitchenStore.todayData?.ordersForNow }}
88
</h3>
99
</div>

apps/atrium-telegram/app/composables/useNavigation.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ function _useNavigation() {
44
const { y } = useWindowScroll()
55

66
const taskStore = useTaskStore()
7+
const flowStore = useFlowStore()
78

89
const mainRoutes = computed<NavigationRoute[]>(() => [
910
{
@@ -12,6 +13,7 @@ function _useNavigation() {
1213
title: t('app.flow'),
1314
icon: 'i-lucide-waves',
1415
exact: true,
16+
badge: flowStore.nowViewedItemsCount.toString(),
1517
},
1618
{
1719
path: '/epic',

apps/atrium-telegram/app/pages/epic/[epicId]/index.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
/>
1414
</div>
1515

16-
<h2 class="text-xl font-bold">
16+
<h1 class="text-2xl/6 font-bold">
1717
{{ epic?.title }}
18-
</h2>
18+
</h1>
1919

2020
<div class="w-full text-base/5 whitespace-pre-wrap break-words">
2121
{{ epic?.description }}

0 commit comments

Comments
 (0)