Skip to content

Commit d7c1f08

Browse files
committed
refactor: remove unused code
1 parent ba634c3 commit d7c1f08

File tree

3 files changed

+39
-75
lines changed

3 files changed

+39
-75
lines changed

resources/js/components/Profile/UserProfileInformationSection.vue

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import type { PageProps } from '@inertiajs/core'
33
import type { User } from '@/types/user'
44
import currentUserPhoto from '@/routes/current-user-photo'
55
import userProfileInformation from '@/routes/user-profile-information'
6+
import { send } from '@/routes/verification'
67
78
const userProfileInformationSection = tv({
89
slots: {
@@ -50,6 +51,20 @@ function onRemoveProfilePicture() {
5051
profilePictureForm.submit(currentUserPhoto.destroy())
5152
}
5253
54+
const toast = useToast()
55+
const sendVerificationEmailForm = useForm({})
56+
function onSendVerificationEmail() {
57+
sendVerificationEmailForm.submit(send(), {
58+
onSuccess: () => {
59+
toast.add({
60+
color: 'info',
61+
icon: 'i-lucide-mail',
62+
title: 'Verification email sent',
63+
})
64+
},
65+
})
66+
}
67+
5368
const ui = computed(() => userProfileInformationSection())
5469
</script>
5570

@@ -145,6 +160,16 @@ const ui = computed(() => userProfileInformationSection())
145160
description="Please verify your email address to unlock all features."
146161
color="warning"
147162
variant="subtle"
163+
orientation="horizontal"
164+
:actions="[
165+
{
166+
label: 'Resend verification email',
167+
color: 'warning',
168+
variant: 'solid',
169+
loading: sendVerificationEmailForm.processing,
170+
onClick: () => onSendVerificationEmail(),
171+
},
172+
]"
148173
/>
149174
</form>
150175
</ProfileSection>

resources/js/components/UserMenu.vue

Lines changed: 2 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,6 @@ defineProps<{
1212
const colorMode = useColorMode()
1313
const appConfig = useAppConfig()
1414
15-
const colors = ['red', 'orange', 'amber', 'yellow', 'lime', 'green', 'emerald', 'teal', 'cyan', 'sky', 'blue', 'indigo', 'violet', 'purple', 'fuchsia', 'pink', 'rose']
16-
const neutrals = ['slate', 'gray', 'zinc', 'neutral', 'stone']
17-
1815
interface Page extends PageProps {
1916
auth: {
2017
user: User
@@ -39,58 +36,7 @@ const items = computed<DropdownMenuItem[][]>(() => ([[{
3936
icon: 'i-lucide-user',
4037
to: profile.show().url,
4138
active: page.component === 'user/profile/index',
42-
}, {
43-
label: 'Billing',
44-
icon: 'i-lucide-credit-card',
45-
}, {
46-
label: 'Settings',
47-
icon: 'i-lucide-settings',
48-
to: '/settings',
4939
}], [{
50-
label: 'Theme',
51-
icon: 'i-lucide-palette',
52-
children: [{
53-
label: 'Primary',
54-
slot: 'chip',
55-
chip: appConfig.ui.colors.primary,
56-
content: {
57-
align: 'center',
58-
collisionPadding: 16,
59-
},
60-
children: colors.map(color => ({
61-
label: color,
62-
chip: color,
63-
slot: 'chip',
64-
checked: appConfig.ui.colors.primary === color,
65-
type: 'checkbox',
66-
onSelect: (e) => {
67-
e.preventDefault()
68-
69-
appConfig.ui.colors.primary = color
70-
},
71-
})),
72-
}, {
73-
label: 'Neutral',
74-
slot: 'chip',
75-
chip: appConfig.ui.colors.neutral === 'neutral' ? 'old-neutral' : appConfig.ui.colors.neutral,
76-
content: {
77-
align: 'end',
78-
collisionPadding: 16,
79-
},
80-
children: neutrals.map(color => ({
81-
label: color,
82-
chip: color === 'neutral' ? 'old-neutral' : color,
83-
slot: 'chip',
84-
type: 'checkbox',
85-
checked: appConfig.ui.colors.neutral === color,
86-
onSelect: (e) => {
87-
e.preventDefault()
88-
89-
appConfig.ui.colors.neutral = color
90-
},
91-
})),
92-
}],
93-
}, {
9440
label: 'Appearance',
9541
icon: 'i-lucide-sun-moon',
9642
children: [{
@@ -120,17 +66,12 @@ const items = computed<DropdownMenuItem[][]>(() => ([[{
12066
}], [{
12167
label: 'Documentation',
12268
icon: 'i-lucide-book-open',
123-
to: 'https://ui.nuxt.com/getting-started/installation/pro/vue',
69+
to: 'https://ui.nuxt.com/getting-started/installation/vue',
12470
target: '_blank',
12571
}, {
12672
label: 'GitHub repository',
12773
icon: 'simple-icons:github',
128-
to: 'https://github.com/nuxt-ui-pro/dashboard-vue',
129-
target: '_blank',
130-
}, {
131-
label: 'Upgrade to Pro',
132-
icon: 'i-lucide-rocket',
133-
to: 'https://ui.nuxt.com/pro/purchase',
74+
to: 'https://github.com/barbapapazes/starter-kit-laravel-nuxt-ui',
13475
target: '_blank',
13576
}], [{
13677
label: 'Log out',

resources/js/layouts/dashboard.vue

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,29 @@
22
import type { NavigationMenuItem } from '@nuxt/ui'
33
import { useStorage } from '@vueuse/core'
44
import { computed, ref } from 'vue'
5+
import { dashboard } from '@/routes'
6+
import profile from '@/routes/profile'
57
68
const props = defineProps<{
79
title: string
810
}>()
911
10-
const toast = useToast()
11-
12-
const open = ref(false)
12+
const page = usePage()
1313
1414
const links = [[{
1515
label: 'Home',
1616
icon: 'i-lucide-house',
17-
to: '/',
18-
onSelect: () => {
19-
open.value = false
20-
},
17+
to: dashboard().url,
18+
active: page.component === 'dashboard',
19+
}, {
20+
label: 'Profile',
21+
icon: 'i-lucide-user',
22+
to: profile.show().url,
23+
active: page.component === 'user/profile/index',
2124
}], [{
2225
label: 'Feedback',
2326
icon: 'i-lucide-message-circle',
24-
to: 'https://github.com/nuxt-ui-pro/dashboard-vue',
25-
target: '_blank',
26-
}, {
27-
label: 'Help & Support',
28-
icon: 'i-lucide-info',
29-
to: 'https://github.com/nuxt/ui-pro',
27+
to: 'https://github.com/barbapapazes/starter-kit-laravel-nuxt-ui',
3028
target: '_blank',
3129
}]] satisfies NavigationMenuItem[][]
3230
@@ -46,6 +44,7 @@ const groups = computed(() => [{
4644
}],
4745
}])
4846
47+
const toast = useToast()
4948
const cookie = useStorage('cookie-consent', 'pending')
5049
if (cookie.value !== 'accepted') {
5150
toast.add({
@@ -79,7 +78,6 @@ if (cookie.value !== 'accepted') {
7978
<UDashboardGroup unit="rem" storage="local">
8079
<UDashboardSidebar
8180
id="default"
82-
v-model:open="open"
8381
collapsible
8482
resizable
8583
class="bg-elevated/25"

0 commit comments

Comments
 (0)