-
Notifications
You must be signed in to change notification settings - Fork 4
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
Merged
Merged
settings page #169
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
4ceed73
settings page layout done
ananyayaya129 5455a76
settings page layout done
ananyayaya129 8c04eb3
formt fix
ananyayaya129 5c4d0c5
format fix
ananyayaya129 81ea778
format fix
ananyayaya129 9b005d2
routing for settings page fixed
ananyayaya129 d0dd91a
settings page buttons
ananyayaya129 29ebc0a
settings page buttons
ananyayaya129 a8176e8
merge conflict
ananyayaya129 5770175
settings page tertiary pages
ananyayaya129 f30e4d0
settings pages all done
ananyayaya129 fb10e4a
settings pages unnecessary page deleted
ananyayaya129 daf56d8
requested changes done
ananyayaya129 bea6565
requested changes done
ananyayaya129 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
platforms/metagram/src/lib/fragments/RightAside/RightAside.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
27 changes: 27 additions & 0 deletions
27
platforms/metagram/src/lib/fragments/SettingsDeleteButton/SettingsDeleteButton.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Show resolved
Hide resolved
|
||
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
platforms/metagram/src/lib/fragments/SettingsPage/SettingsPage.svelte
ananyayaya129 marked this conversation as resolved.
Show resolved
Hide resolved
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 :) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
Show resolved
Hide resolved
|
24 changes: 24 additions & 0 deletions
24
platforms/metagram/src/lib/fragments/SettingsToggleButton/SettingsToggleButton.svelte
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.