Skip to content

Commit c8ed052

Browse files
committed
feat: drawer
1 parent 9a7fd07 commit c8ed052

File tree

4 files changed

+38
-9
lines changed

4 files changed

+38
-9
lines changed

frontend/app/components/PageLayout.vue

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,11 @@ withDefaults(
33
defineProps<{
44
title: string
55
bottomPadding?: boolean
6+
shadow?: boolean
67
}>(),
78
{
89
bottomPadding: true,
10+
shadow: true,
911
},
1012
)
1113
@@ -18,7 +20,9 @@ const hasScrolled = computed(() => y.value > 25)
1820
<div class="sticky top-0 z-10">
1921
<ProgressiveBlur
2022
direction="up"
21-
class="from-shadow-blank/0 to-shadow-default bg-linear-to-t"
23+
:class="[
24+
shadow && 'from-shadow-blank/0 to-shadow-default bg-linear-to-t',
25+
]"
2226
>
2327
<header
2428
:class="[

frontend/app/components/achievements/AchievementBadge.vue

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,7 @@ watch(open, (isOpen) => {
2020

2121
<template>
2222
<div>
23-
<UModal
24-
v-model:open="open"
25-
:ui="{ content: 'bg-background-default' }"
26-
:transition="false"
27-
modal
28-
fullscreen
29-
>
23+
<DesignDrawer v-model:open="open">
3024
<button
3125
class="grid aspect-square place-items-center overflow-hidden rounded-full"
3226
>
@@ -44,6 +38,7 @@ watch(open, (isOpen) => {
4438
<template #content="{ close }">
4539
<PageLayout
4640
:title="achievement.achievedAt ? 'Unlocked!' : 'Achievement'"
41+
:shadow="false"
4742
>
4843
<template #action>
4944
<DesignIconButton icon="lucide:x" @click="close" />
@@ -92,6 +87,6 @@ watch(open, (isOpen) => {
9287
</div>
9388
</PageLayout>
9489
</template>
95-
</UModal>
90+
</DesignDrawer>
9691
</div>
9792
</template>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<script setup lang="ts">
2+
const open = defineModel<boolean>('open')
3+
const close = () => {
4+
open.value = false
5+
}
6+
</script>
7+
8+
<template>
9+
<UDrawer
10+
v-model:open="open"
11+
:ui="{
12+
content:
13+
'bg-background-raised rounded-t-list ring-border-default h-[95%]',
14+
overlay: 'bg-black/50',
15+
handle: 'bg-border-default!',
16+
}"
17+
should-scale-background
18+
:set-background-color-on-scale="false"
19+
>
20+
<template #default>
21+
<slot />
22+
</template>
23+
<template #content>
24+
<slot name="content" :close />
25+
</template>
26+
</UDrawer>
27+
</template>

frontend/nuxt.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@ export default defineNuxtConfig({
1717
typedPages: true,
1818
},
1919
app: {
20+
rootAttrs: {
21+
'data-vaul-drawer-wrapper': '',
22+
},
2023
head: {
2124
title: 'Interact',
2225
meta: [

0 commit comments

Comments
 (0)