Skip to content

Commit 27f6e2f

Browse files
authored
feat(profile): settings dialog and user profile component (#692)
* feat(profile): settings dialog and user profile component * feat(docs): add changeset
1 parent 94a90ac commit 27f6e2f

File tree

2 files changed

+41
-11
lines changed

2 files changed

+41
-11
lines changed

.changeset/fast-spies-tease.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"enspire": minor
3+
---
4+
5+
Settings dialog and user profile component

app/pages/profile.vue

Lines changed: 36 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
<script setup lang="ts">
22
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'
36
import type { MyRecords } from '@@/types/api/cas/record/my'
47
import { useUser } from 'vue-clerk'
58
import { usePreferredDark } from '@vueuse/core'
@@ -9,6 +12,9 @@ import {
912
Settings,
1013
Clock,
1114
} from 'lucide-vue-next'
15+
import { UserProfile } from 'vue-clerk'
16+
17+
const isDark = usePreferredDark()
1218
1319
definePageMeta({
1420
middleware: ['auth'],
@@ -29,6 +35,9 @@ const stats = ref({
2935
3036
const isLoading = ref(true)
3137
38+
// Add this with your other refs
39+
const isSettingsOpen = ref(false)
40+
3241
// Fetch clubs data
3342
const { data: clubs } = await useQuery<AllClubs>({
3443
queryKey: ['/api/user/all_clubs'],
@@ -84,24 +93,40 @@ onMounted(() => {
8493
<Card>
8594
<CardHeader>
8695
<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>
98109
</div>
99110
</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>
100115
</div>
101116
</CardTitle>
102117
</CardHeader>
118+
<!-- Rest of your existing card content -->
103119
</Card>
104120

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+
105130
<div class="grid gap-4 md:grid-cols-2">
106131
<!-- Account Info Card -->
107132
<Card>

0 commit comments

Comments
 (0)