1
1
<script setup lang="ts">
2
2
import type { AllClubs } from ' @@/types/api/user/all_clubs'
3
+ import { Button } from ' @/components/ui/button'
4
+ import { dark } from ' @clerk/themes'
5
+ import { Dialog , DialogContent } from ' @/components/ui/dialog'
3
6
import type { MyRecords } from ' @@/types/api/cas/record/my'
4
7
import { useUser } from ' vue-clerk'
5
8
import { usePreferredDark } from ' @vueuse/core'
@@ -9,6 +12,9 @@ import {
9
12
Settings ,
10
13
Clock ,
11
14
} from ' lucide-vue-next'
15
+ import { UserProfile } from ' vue-clerk'
16
+
17
+ const isDark = usePreferredDark ()
12
18
13
19
definePageMeta ({
14
20
middleware: [' auth' ],
@@ -29,6 +35,9 @@ const stats = ref({
29
35
30
36
const isLoading = ref (true )
31
37
38
+ // Add this with your other refs
39
+ const isSettingsOpen = ref (false )
40
+
32
41
// Fetch clubs data
33
42
const { data : clubs } = await useQuery <AllClubs >({
34
43
queryKey: [' /api/user/all_clubs' ],
@@ -84,24 +93,40 @@ onMounted(() => {
84
93
<Card >
85
94
<CardHeader >
86
95
<CardTitle class =" text-3xl" >
87
- <div class =" flex items-center gap-4" >
88
- <Avatar class =" h-16 w-16 rounded-lg" >
89
- <AvatarImage v-if =" user" :src =" user.imageUrl" :alt =" user.firstName" />
90
- <AvatarFallback class =" rounded-lg" >
91
- {{ user?.firstName?.slice(0, 2) }}
92
- </AvatarFallback >
93
- </Avatar >
94
- <div >
95
- 👋 Hi, {{ user?.firstName }}!
96
- <div class =" text-base font-normal text-muted-foreground" >
97
- {{ user?.primaryEmailAddress }}
96
+ <div class =" flex items-center justify-between w-full" >
97
+ <div class =" flex items-center gap-4" >
98
+ <Avatar class =" h-16 w-16 rounded-lg" >
99
+ <AvatarImage v-if =" user" :src =" user.imageUrl" :alt =" user.firstName" />
100
+ <AvatarFallback class =" rounded-lg" >
101
+ {{ user?.firstName?.slice(0, 2) }}
102
+ </AvatarFallback >
103
+ </Avatar >
104
+ <div >
105
+ 👋🏻 Hi, {{ user?.firstName }}!
106
+ <div class =" text-base font-normal text-muted-foreground" >
107
+ {{ user?.primaryEmailAddress }}
108
+ </div >
98
109
</div >
99
110
</div >
111
+ <Button variant =" ghost" size =" icon" @click =" isSettingsOpen = true" >
112
+ <Settings class =" h-5 w-5" />
113
+ <span class =" sr-only" >Open settings</span >
114
+ </Button >
100
115
</div >
101
116
</CardTitle >
102
117
</CardHeader >
118
+ <!-- Rest of your existing card content -->
103
119
</Card >
104
120
121
+ <!-- Settings Dialog -->
122
+ <Dialog :open =" isSettingsOpen" @update:open =" isSettingsOpen = false" >
123
+ <DialogContent class =" sm:max-w-[880px] p-0" >
124
+ <UserProfile
125
+ :appearance =" { baseTheme: isDark ? dark : undefined }"
126
+ />
127
+ </DialogContent >
128
+ </Dialog >
129
+
105
130
<div class =" grid gap-4 md:grid-cols-2" >
106
131
<!-- Account Info Card -->
107
132
<Card >
0 commit comments