|
1 | 1 | <script setup lang="ts">
|
2 |
| -import type { DropdownItem } from '#ui/types' |
| 2 | +import type { DropdownMenuItem } from '#ui/types' |
3 | 3 |
|
4 | 4 | const { loggedIn, user, clear } = useUserSession()
|
5 | 5 | const colorMode = useColorMode()
|
@@ -35,108 +35,109 @@ const items = [
|
35 | 35 | [
|
36 | 36 | {
|
37 | 37 | label: 'Logout',
|
38 |
| - icon: 'i-heroicons-arrow-left-on-rectangle', |
39 |
| - click: clear |
| 38 | + icon: 'i-lucide-log-out', |
| 39 | + onSelect: clear |
40 | 40 | }
|
41 | 41 | ]
|
42 |
| -] satisfies DropdownItem[][] |
| 42 | +] satisfies DropdownMenuItem[][] |
43 | 43 | </script>
|
44 | 44 |
|
45 | 45 | <template>
|
46 |
| - <UContainer class="min-h-screen flex flex-col my-4"> |
47 |
| - <div class="mb-2 text-right"> |
48 |
| - <UButton |
49 |
| - square |
50 |
| - variant="ghost" |
51 |
| - color="black" |
52 |
| - :icon=" |
53 |
| - $colorMode.preference === 'dark' || $colorMode.preference === 'system' |
54 |
| - ? 'i-heroicons-moon' |
55 |
| - : 'i-heroicons-sun' |
56 |
| - " |
57 |
| - @click="isDarkMode = !isDarkMode" |
58 |
| - /> |
59 |
| - </div> |
60 |
| - |
61 |
| - <UCard> |
62 |
| - <template #header> |
63 |
| - <h3 class="text-lg font-semibold leading-6"> |
64 |
| - <NuxtLink to="/"> |
65 |
| - Atidone |
66 |
| - </NuxtLink> |
67 |
| - </h3> |
| 46 | + <UApp> |
| 47 | + <UContainer class="min-h-screen flex flex-col my-4"> |
| 48 | + <div class="mb-2 text-right"> |
68 | 49 | <UButton
|
69 |
| - v-if="!loggedIn" |
70 |
| - to="/api/auth/github" |
71 |
| - icon="i-simple-icons-github" |
72 |
| - label="Login with GitHub" |
73 |
| - color="black" |
74 |
| - size="xs" |
75 |
| - external |
| 50 | + square |
| 51 | + variant="ghost" |
| 52 | + color="neutral" |
| 53 | + :icon=" |
| 54 | + $colorMode.preference === 'dark' || $colorMode.preference === 'system' |
| 55 | + ? 'i-lucide-moon' |
| 56 | + : 'i-lucide-sun' |
| 57 | + " |
| 58 | + @click="isDarkMode = !isDarkMode" |
76 | 59 | />
|
77 |
| - <div |
78 |
| - v-else |
79 |
| - class="flex flex-wrap -mx-2 sm:mx-0" |
80 |
| - > |
81 |
| - <UButton |
82 |
| - to="/todos" |
83 |
| - icon="i-heroicons-list-bullet" |
84 |
| - label="Todos" |
85 |
| - :color="$route.path === '/todos' ? 'primary' : 'gray'" |
86 |
| - variant="ghost" |
87 |
| - /> |
| 60 | + </div> |
| 61 | + |
| 62 | + <UCard variant="subtle"> |
| 63 | + <template #header> |
| 64 | + <h3 class="text-lg font-semibold leading-6"> |
| 65 | + <NuxtLink to="/"> |
| 66 | + Atidone |
| 67 | + </NuxtLink> |
| 68 | + </h3> |
88 | 69 | <UButton
|
89 |
| - to="/optimistic-todos" |
90 |
| - icon="i-heroicons-sparkles" |
91 |
| - label="Optimistic Todos" |
92 |
| - :color="$route.path === '/optimistic-todos' ? 'primary' : 'gray'" |
93 |
| - variant="ghost" |
| 70 | + v-if="!loggedIn" |
| 71 | + to="/api/auth/github" |
| 72 | + icon="i-simple-icons-github" |
| 73 | + label="Login with GitHub" |
| 74 | + color="neutral" |
| 75 | + size="xs" |
| 76 | + external |
94 | 77 | />
|
95 |
| - <UDropdown |
96 |
| - v-if="user" |
97 |
| - :items="items" |
| 78 | + <div |
| 79 | + v-else |
| 80 | + class="flex flex-wrap -mx-2 sm:mx-0" |
98 | 81 | >
|
99 | 82 | <UButton
|
100 |
| - color="gray" |
| 83 | + to="/todos" |
| 84 | + icon="i-lucide-list" |
| 85 | + label="Todos" |
| 86 | + :color="$route.path === '/todos' ? 'primary' : 'neutral'" |
101 | 87 | variant="ghost"
|
102 |
| - trailing-icon="i-heroicons-chevron-down-20-solid" |
| 88 | + /> |
| 89 | + <UButton |
| 90 | + to="/optimistic-todos" |
| 91 | + icon="i-lucide-sparkles" |
| 92 | + label="Optimistic Todos" |
| 93 | + :color="$route.path === '/optimistic-todos' ? 'primary' : 'neutral'" |
| 94 | + variant="ghost" |
| 95 | + /> |
| 96 | + <UDropdownMenu |
| 97 | + v-if="user" |
| 98 | + :items="items" |
103 | 99 | >
|
104 |
| - <UAvatar |
105 |
| - :src="`https://github.com/${user.login}.png`" |
106 |
| - :alt="user.login" |
107 |
| - size="3xs" |
108 |
| - /> |
109 |
| - {{ user.login }} |
110 |
| - </UButton> |
111 |
| - </UDropdown> |
112 |
| - </div> |
113 |
| - </template> |
114 |
| - <NuxtPage /> |
115 |
| - </UCard> |
| 100 | + <UButton |
| 101 | + color="neutral" |
| 102 | + variant="ghost" |
| 103 | + trailing-icon="i-lucide-chevron-down" |
| 104 | + > |
| 105 | + <UAvatar |
| 106 | + :src="`https://github.com/${user.login}.png`" |
| 107 | + :alt="user.login" |
| 108 | + size="3xs" |
| 109 | + /> |
| 110 | + {{ user.login }} |
| 111 | + </UButton> |
| 112 | + </UDropdownMenu> |
| 113 | + </div> |
| 114 | + </template> |
| 115 | + <NuxtPage /> |
| 116 | + </UCard> |
116 | 117 |
|
117 |
| - <footer class="text-center mt-2"> |
118 |
| - <NuxtLink |
119 |
| - href="https://github.com/atinux/atidone" |
120 |
| - target="_blank" |
121 |
| - class="text-sm text-gray-500 hover:text-gray-700" |
122 |
| - > |
123 |
| - GitHub |
124 |
| - </NuxtLink> |
125 |
| - · |
126 |
| - <NuxtLink |
127 |
| - href="https://twitter.com/atinux" |
128 |
| - target="_blank" |
129 |
| - class="text-sm text-gray-500 hover:text-gray-700" |
130 |
| - > |
131 |
| - Twitter |
132 |
| - </NuxtLink> |
133 |
| - </footer> |
134 |
| - </UContainer> |
135 |
| - <UNotifications /> |
| 118 | + <footer class="text-center mt-2"> |
| 119 | + <NuxtLink |
| 120 | + href="https://github.com/atinux/atidone" |
| 121 | + target="_blank" |
| 122 | + class="text-sm text-neutral-500 hover:text-neutral-700" |
| 123 | + > |
| 124 | + GitHub |
| 125 | + </NuxtLink> |
| 126 | + · |
| 127 | + <NuxtLink |
| 128 | + href="https://twitter.com/atinux" |
| 129 | + target="_blank" |
| 130 | + class="text-sm text-neutral-500 hover:text-neutral-700" |
| 131 | + > |
| 132 | + Twitter |
| 133 | + </NuxtLink> |
| 134 | + </footer> |
| 135 | + </UContainer> |
| 136 | + </UApp> |
136 | 137 | </template>
|
137 | 138 |
|
138 | 139 | <style lang="postcss">
|
139 | 140 | body {
|
140 |
| - @apply font-sans text-gray-950 bg-gray-50 dark:bg-gray-950 dark:text-gray-50; |
| 141 | + @apply font-sans text-neutral-950 bg-neutral-50 dark:bg-neutral-950 dark:text-neutral-50; |
141 | 142 | }
|
142 | 143 | </style>
|
0 commit comments