Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 8
settings page#169
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
settings page #169
Changes from all commits
4ceed735455a768c04eb35c4d0c581ea7789b005d2d0dd91a29ebc0aa8176e85770175f30e4d0fb10e4adaf56d8bea6565File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| <script lang="ts"> | ||
| import type { Snippet } from 'svelte'; | ||
| import type { HTMLAttributes } from 'svelte/elements'; | ||
| import { Header } from '..'; | ||
| interface IRightAsideProps extends HTMLAttributes<HTMLElement> { | ||
| header: Snippet; | ||
| asideContent: Snippet; | ||
| } | ||
| let { header, asideContent, ...restProps }: IRightAsideProps = $props(); | ||
| </script> | ||
| <aside {...restProps} class="hidden border border-y-0 border-s-gray-200 md:block md:pt-13"> | ||
| <div class="mx-5"> | ||
| <h2 class="mb-10 text-lg font-semibold"> | ||
| {@render header?.()} | ||
| </h2> | ||
| <div> | ||
| {@render asideContent?.()} | ||
| </div> | ||
| </div> | ||
| </aside> |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| <script lang="ts"> | ||
| import { cn } from '$lib/utils'; | ||
| import { Delete02Icon } from '@hugeicons/core-free-icons'; | ||
| import { HugeiconsIcon } from '@hugeicons/svelte'; | ||
| import type { Snippet } from 'svelte'; | ||
| import type { HTMLAttributes } from 'svelte/elements'; | ||
| interface ISettingsDeleteButtonProps extends HTMLAttributes<HTMLElement> { | ||
| children: Snippet; | ||
| onclick: () => void; | ||
| } | ||
| let { children, onclick, ...restProps }: ISettingsDeleteButtonProps = $props(); | ||
| const cBase = 'flex w-full items-center justify-between'; | ||
| </script> | ||
| <div {...restProps} class={cn([cBase, restProps.class].join(' '))}> | ||
| <div class="flex items-center gap-2"> | ||
| <h3 class="text-black-800 text-base"> | ||
| {@render children?.()} | ||
| </h3> | ||
| </div> | ||
| <button class="cursor-pointer" {onclick}> | ||
| <HugeiconsIcon icon={Delete02Icon} color="var(--color-black-400)" /> | ||
| </button> | ||
ananyayaya129 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| </div> | ||
ananyayaya129 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. Contributor There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is obsolete now :) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| <script lang="ts"> | ||
| import { goto } from '$app/navigation'; | ||
| import { page } from '$app/state'; | ||
| import SettingsNavigationButton from '$lib/fragments/SettingsNavigationButton/SettingsNavigationButton.svelte'; | ||
| import { | ||
| DatabaseIcon, | ||
| Logout01Icon, | ||
| Notification02FreeIcons | ||
| } from '@hugeicons/core-free-icons'; | ||
| import { HugeiconsIcon } from '@hugeicons/svelte'; | ||
| import type { HTMLAttributes } from 'svelte/elements'; | ||
| let route = $derived(page.url.pathname); | ||
| interface ISettingsPageProps extends HTMLAttributes<HTMLElement> { | ||
| username: string; | ||
| userEmail: string; | ||
| } | ||
| let { username, userEmail }: ISettingsPageProps = $props(); | ||
| </script> | ||
| <div class="bg-grey rounded-xl p-3 md:p-5"> | ||
| <SettingsNavigationButton | ||
| onclick={() => goto(`/settings/account`)} | ||
| profileSrc="https://picsum.photos/200/300" | ||
| > | ||
| {#snippet children()} | ||
| <div class="flex flex-col items-start"> | ||
| <h2 class="text-lg">{username}</h2> | ||
| <p class="text-sm">{userEmail}</p> | ||
| </div> | ||
| {/snippet} | ||
| </SettingsNavigationButton> | ||
| </div> | ||
| <hr class="text-grey" /> | ||
| <div class="flex flex-col gap-3"> | ||
| <h3 class="text-brand-burnt-orange text-base font-semibold">Personalisation</h3> | ||
| <div class="{route === `/settings/notifications` ? 'bg-grey' : ''} rounded-xl p-2"> | ||
| <SettingsNavigationButton onclick={() => goto(`/settings/notifications`)}> | ||
| {#snippet leadingIcon()} | ||
| <HugeiconsIcon | ||
| size="24px" | ||
| icon={Notification02FreeIcons} | ||
| color="var(--color-brand-burnt-orange)" | ||
| /> | ||
| {/snippet} | ||
| {#snippet children()} | ||
| Notifications | ||
| {/snippet} | ||
| </SettingsNavigationButton> | ||
| </div> | ||
| </div> | ||
| <hr class="text-grey" /> | ||
| <div class="flex flex-col gap-3"> | ||
| <h3 class="text-brand-burnt-orange text-base font-semibold">System</h3> | ||
| <div class="{route === `/settings/data-and-storage` ? 'bg-grey' : ''} rounded-xl p-2"> | ||
| <SettingsNavigationButton onclick={() => goto(`/settings/data-and-storage`)}> | ||
| {#snippet leadingIcon()} | ||
| <HugeiconsIcon | ||
| size="24px" | ||
| icon={DatabaseIcon} | ||
| color="var(--color-brand-burnt-orange)" | ||
| /> | ||
| {/snippet} | ||
| {#snippet children()} | ||
| Data & Storage | ||
| {/snippet} | ||
| </SettingsNavigationButton> | ||
| </div> | ||
| <div class="{route === `/settings/logout` ? 'bg-grey' : ''} rounded-xl p-2"> | ||
| <SettingsNavigationButton onclick={() => goto(`/settings/logout`)}> | ||
| {#snippet leadingIcon()} | ||
| <HugeiconsIcon | ||
| size="24px" | ||
| icon={Logout01Icon} | ||
| color="var(--color-brand-burnt-orange)" | ||
| /> | ||
| {/snippet} | ||
| {#snippet children()} | ||
| Logout | ||
| {/snippet} | ||
| </SettingsNavigationButton> | ||
| </div> | ||
| </div> | ||
ananyayaya129 marked this conversation as resolved.
Uh oh!There was an error while loading. Please reload this page. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| <script lang="ts"> | ||
| import { Toggle } from '$lib/ui'; | ||
| import { cn } from '$lib/utils'; | ||
| import type { Snippet } from 'svelte'; | ||
| import type { HTMLButtonAttributes } from 'svelte/elements'; | ||
| interface ISettingsToggleButtonProps extends HTMLButtonAttributes { | ||
| children: Snippet; | ||
| checked: boolean; | ||
| } | ||
| let { children, onclick, checked, ...restProps }: ISettingsToggleButtonProps = $props(); | ||
| const cBase = 'flex w-full items-center justify-between'; | ||
| </script> | ||
| <button {...restProps} class={cn([cBase, restProps.class].join(' '))} {onclick}> | ||
| <div class="flex items-center gap-2"> | ||
| <h3 class="text-black-800 text-base"> | ||
| {@render children?.()} | ||
| </h3> | ||
| </div> | ||
| <Toggle {checked}></Toggle> | ||
| </button> |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.