Skip to content

Commit e84cf7b

Browse files
committed
Adding updated styles to delete section
1 parent bfe28f4 commit e84cf7b

File tree

4 files changed

+57
-49
lines changed

4 files changed

+57
-49
lines changed

resources/js/components/NavMain.vue

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,11 @@ import {
88
SidebarMenuButton,
99
} from '@/components/ui/sidebar';
1010
11-
interface Props {
11+
const props = defineProps<{
1212
items?: NavItemType[];
13-
}
13+
}>();
1414
1515
const page = usePage();
16-
17-
withDefaults(defineProps<Props>(), {
18-
items: () => [],
19-
});
2016
</script>
2117

2218
<template>

resources/js/components/settings/DeleteUser.vue

Lines changed: 46 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -48,48 +48,54 @@ const closeModal = () => {
4848
title="Delete Account"
4949
description="Delete your account and all of its resources"
5050
/>
51-
<Dialog>
52-
<DialogTrigger as-child>
53-
<Button variant="destructive">Delete Account</Button>
54-
</DialogTrigger>
55-
<DialogContent>
56-
<form class="space-y-6" @submit="deleteUser">
57-
<DialogHeader class="space-y-3">
58-
<DialogTitle>Are you sure you want to delete your account?</DialogTitle>
59-
<DialogDescription>
60-
Once your account is deleted, all of its resources and data will also be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.
61-
</DialogDescription>
62-
</DialogHeader>
63-
<div class="grid gap-2">
64-
<Label for="password" class="sr-only">Password</Label>
51+
<div className="border border-red-100 dark:border-red-950 p-3 rounded-lg flex items-center bg-red-50 dark:bg-red-500/20">
52+
<Dialog>
53+
<DialogTrigger as-child>
54+
<Button variant="destructive">Delete Account</Button>
55+
</DialogTrigger>
56+
<DialogContent>
57+
<form class="space-y-6" @submit="deleteUser">
58+
<DialogHeader class="space-y-3">
59+
<DialogTitle>Are you sure you want to delete your account?</DialogTitle>
60+
<DialogDescription>
61+
Once your account is deleted, all of its resources and data will also be permanently deleted. Please enter your password to confirm you would like to permanently delete your account.
62+
</DialogDescription>
63+
</DialogHeader>
64+
<div class="grid gap-2">
65+
<Label for="password" class="sr-only">Password</Label>
6566

66-
<Input
67-
id="password"
68-
type="password"
69-
name="password"
70-
ref="passwordInput"
71-
v-model="form.password"
72-
placeholder="Password"
73-
/>
67+
<Input
68+
id="password"
69+
type="password"
70+
name="password"
71+
ref="passwordInput"
72+
v-model="form.password"
73+
placeholder="Password"
74+
/>
7475

75-
<InputError :message="form.errors.password" />
76-
</div>
77-
78-
<DialogFooter>
79-
<DialogClose as-child>
80-
<Button variant="secondary" @click="closeModal">
81-
Cancel
82-
</Button>
83-
</DialogClose>
76+
<InputError :message="form.errors.password" />
77+
</div>
78+
79+
<DialogFooter>
80+
<DialogClose as-child>
81+
<Button variant="secondary" @click="closeModal">
82+
Cancel
83+
</Button>
84+
</DialogClose>
8485

85-
<Button variant="destructive" :disabled="form.processing">
86-
<button type="submit">
87-
Delete Account
88-
</button>
89-
</Button>
90-
</DialogFooter>
91-
</form>
92-
</DialogContent>
93-
</Dialog>
86+
<Button variant="destructive" :disabled="form.processing">
87+
<button type="submit">
88+
Delete Account
89+
</button>
90+
</Button>
91+
</DialogFooter>
92+
</form>
93+
</DialogContent>
94+
</Dialog>
95+
<div className="relative text-red-600 dark:text-red-100 ml-3">
96+
<p className="font-medium leading-none mb-1 text-sm">Warning</p>
97+
<p className="leading-none text-xs">Please proceed with caution, this cannot be undone</p>
98+
</div>
99+
</div>
94100
</div>
95101
</template>

resources/js/layouts/AppLayout.vue

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,17 @@ const props = withDefaults(defineProps<Props>(), {
3030
breadcrumbs: () => [],
3131
});
3232
33-
const isOpen = ref(localStorage.getItem('sidebar') === 'true');
33+
const isOpen = ref(
34+
typeof window !== 'undefined'
35+
? localStorage.getItem('sidebar') !== 'false'
36+
: true
37+
);
3438
3539
const handleSidebarChange = (open: boolean) => {
3640
isOpen.value = open;
37-
localStorage.setItem('sidebar', String(open));
41+
if (typeof window !== 'undefined') {
42+
localStorage.setItem('sidebar', String(open));
43+
}
3844
};
3945
</script>
4046

resources/js/pages/settings/Layout.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ const currentItem = sidebarNavItems.find(item => currentPath === item.href)
4242
<Button
4343
v-for="item in sidebarNavItems"
4444
:key="item.href"
45-
size="sm"
4645
variant="ghost"
4746
:class="[
4847
'w-full justify-center justify-start',
4948
currentPath === item.href ? 'bg-muted' : 'hover:underline'
5049
]"
50+
as-child
5151
>
5252
<Link :href="item.href">
5353
{{ item.title }}

0 commit comments

Comments
 (0)