update settings page layout for scrolling

pull/3/head
TZGyn 2 years ago
parent 0ebd62f3bd
commit bbf525142a
Signed by: TZGyn
GPG Key ID: 122EAF77AE81FD4A

@ -15,13 +15,10 @@
{#each items as item} {#each items as item}
<Button <Button
href={item.href} href={item.href}
variant="ghost" variant={$page.url.pathname == item.href
class={cn( ? 'secondary'
$page.url.pathname === item.href : 'ghost'}
? 'bg-muted hover:bg-muted' class="justify-start hover:bg-secondary/50">
: 'hover:bg-transparent hover:underline',
'justify-start',
)}>
{item.title} {item.title}
</Button> </Button>
{/each} {/each}

@ -1,4 +1,5 @@
<script lang="ts"> <script lang="ts">
import { ScrollArea } from '$lib/components/ui/scroll-area'
import { Separator } from '$lib/components/ui/separator' import { Separator } from '$lib/components/ui/separator'
import SidebarNav from './(components)/sidebar-nav.svelte' import SidebarNav from './(components)/sidebar-nav.svelte'
@ -14,21 +15,25 @@
] ]
</script> </script>
<div class="space-y-6 p-10 pb-16"> <div class="flex h-auto flex-col overflow-hidden p-10">
<div class="space-y-0.5"> <div class="space-y-0.5">
<h2 class="text-2xl font-bold tracking-tight">Settings</h2> <h2 class="text-2xl font-bold tracking-tight">Settings</h2>
<p class="text-muted-foreground"> <p class="text-muted-foreground">
Manage your account settings and set e-mail preferences. Manage your account settings and set e-mail preferences.
</p> </p>
</div> </div>
<Separator class="my-6" /> <Separator class="my-4 lg:my-6" />
<div <div class="flex h-auto flex-col overflow-hidden lg:flex-row">
class="flex flex-col space-y-8 lg:flex-row lg:space-x-12 lg:space-y-0"> <aside class="border-b pb-4 lg:w-1/5 lg:border-none">
<aside class="-mx-4 lg:w-1/5">
<SidebarNav items={sidebarNavItems} /> <SidebarNav items={sidebarNavItems} />
</aside> </aside>
<div class="flex-1 lg:max-w-2xl"> <div
class="m-0 flex h-auto w-full overflow-hidden p-0 lg:max-w-2xl">
<ScrollArea class="mt-0 w-full">
<div class="py-6 lg:px-8 lg:py-0">
<slot /> <slot />
</div> </div>
</ScrollArea>
</div>
</div> </div>
</div> </div>

@ -39,10 +39,10 @@
} }
</script> </script>
<div class="space-y-6"> <div class="flex h-auto flex-col gap-6">
<div> <div>
<h3 class="text-lg font-medium">Account</h3> <h3 class="text-lg font-medium">Account</h3>
<p class="text-muted-foreground text-sm"> <p class="text-sm text-muted-foreground">
Update your account settings. Update your account settings.
</p> </p>
</div> </div>
@ -54,7 +54,7 @@
type="text" type="text"
id="username" id="username"
bind:value={account_data.username} /> bind:value={account_data.username} />
<p class="text-muted-foreground text-sm">Change your username.</p> <p class="text-sm text-muted-foreground">Change your username.</p>
</div> </div>
<div class="flex w-full max-w-sm flex-col gap-2"> <div class="flex w-full max-w-sm flex-col gap-2">
@ -64,7 +64,7 @@
type="email" type="email"
id="email" id="email"
bind:value={account_data.email} /> bind:value={account_data.email} />
<p class="text-muted-foreground text-sm">Change your email.</p> <p class="text-sm text-muted-foreground">Change your email.</p>
</div> </div>
<Separator /> <Separator />
@ -75,7 +75,7 @@
type="password" type="password"
id="old_password" id="old_password"
bind:value={account_data.old_password} /> bind:value={account_data.old_password} />
<p class="text-muted-foreground text-sm"> <p class="text-sm text-muted-foreground">
Enter your old password in order to change it. Enter your old password in order to change it.
</p> </p>
</div> </div>
@ -86,7 +86,7 @@
type="password" type="password"
id="new_password" id="new_password"
bind:value={account_data.new_password} /> bind:value={account_data.new_password} />
<p class="text-muted-foreground text-sm">Change your password.</p> <p class="text-sm text-muted-foreground">Change your password.</p>
</div> </div>
<div class="flex w-full max-w-sm flex-col gap-2"> <div class="flex w-full max-w-sm flex-col gap-2">
@ -95,12 +95,15 @@
type="password" type="password"
id="new_password" id="new_password"
bind:value={account_data.confirm_password} /> bind:value={account_data.confirm_password} />
<p class="text-muted-foreground text-sm"> <p class="text-sm text-muted-foreground">
Confirm your new password. Confirm your new password.
</p> </p>
</div> </div>
<Button disabled={isLoading} on:click={submit} class="flex gap-2"> <Button
disabled={isLoading}
on:click={submit}
class="flex w-fit gap-2">
{#if isLoading} {#if isLoading}
<Loader2 class="animate-spin" /> <Loader2 class="animate-spin" />
{/if} {/if}

Loading…
Cancel
Save