top right header
This commit is contained in:
parent
bdaf1a4875
commit
17bbf90b09
5 changed files with 20 additions and 4 deletions
|
|
@ -9,10 +9,10 @@
|
||||||
import { Button } from '$lib/components/ui/button/index.js';
|
import { Button } from '$lib/components/ui/button/index.js';
|
||||||
import type { LightSwitchProps } from './types';
|
import type { LightSwitchProps } from './types';
|
||||||
|
|
||||||
let { variant = 'outline' }: LightSwitchProps = $props();
|
let { variant = 'outline', class: className }: LightSwitchProps = $props();
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Button onclick={toggleMode} {variant} size="icon">
|
<Button onclick={toggleMode} {variant} size="icon" class={className}>
|
||||||
<SunIcon class="absolute scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" />
|
<SunIcon class="absolute scale-0 rotate-90 transition-all dark:scale-100 dark:rotate-0" />
|
||||||
<MoonIcon class="scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" />
|
<MoonIcon class="scale-100 rotate-0 transition-all dark:scale-0 dark:-rotate-90" />
|
||||||
<span class="sr-only">Toggle theme</span>
|
<span class="sr-only">Toggle theme</span>
|
||||||
|
|
|
||||||
|
|
@ -4,4 +4,5 @@
|
||||||
|
|
||||||
export type LightSwitchProps = {
|
export type LightSwitchProps = {
|
||||||
variant?: 'outline' | 'ghost';
|
variant?: 'outline' | 'ghost';
|
||||||
|
class?: string;
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,18 @@
|
||||||
|
|
||||||
@reference './app.css';
|
@reference './app.css';
|
||||||
|
|
||||||
|
.shiki,
|
||||||
|
.shiki span {
|
||||||
|
/* Optional, if you also want font styles */
|
||||||
|
font-style: var(--font-mono) !important;
|
||||||
|
}
|
||||||
|
|
||||||
html.dark .shiki,
|
html.dark .shiki,
|
||||||
html.dark .shiki span {
|
html.dark .shiki span {
|
||||||
color: var(--shiki-dark) !important;
|
color: var(--shiki-dark) !important;
|
||||||
background-color: var(--shiki-dark-bg) !important;
|
background-color: var(--shiki-dark-bg) !important;
|
||||||
/* Optional, if you also want font styles */
|
/* Optional, if you also want font styles */
|
||||||
font-style: var(--shiki-dark-font-style) !important;
|
font-style: var(--font-mono) !important;
|
||||||
font-weight: var(--shiki-dark-font-weight) !important;
|
font-weight: var(--shiki-dark-font-weight) !important;
|
||||||
text-decoration: var(--shiki-dark-text-decoration) !important;
|
text-decoration: var(--shiki-dark-text-decoration) !important;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
0
src/routes/account/+page.svelte
Normal file
0
src/routes/account/+page.svelte
Normal file
|
|
@ -28,6 +28,8 @@
|
||||||
import { cn } from '$lib/utils/utils.js';
|
import { cn } from '$lib/utils/utils.js';
|
||||||
import { pick } from '$lib/utils/object.js';
|
import { pick } from '$lib/utils/object.js';
|
||||||
import ChevronDownIcon from '~icons/lucide/chevron-down';
|
import ChevronDownIcon from '~icons/lucide/chevron-down';
|
||||||
|
import { LightSwitch } from '$lib/components/ui/light-switch/index.js';
|
||||||
|
import Settings2Icon from '~icons/lucide/settings-2';
|
||||||
|
|
||||||
const client = useConvexClient();
|
const client = useConvexClient();
|
||||||
|
|
||||||
|
|
@ -382,7 +384,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="py-2">
|
<div class="py-2">
|
||||||
{#if data.session !== null}
|
{#if data.session !== null}
|
||||||
<Button href="/account/api-keys" variant="ghost" class="h-auto w-full justify-start">
|
<Button href="/account" variant="ghost" class="h-auto w-full justify-start">
|
||||||
<Avatar src={data.session?.user.image ?? undefined}>
|
<Avatar src={data.session?.user.image ?? undefined}>
|
||||||
{#snippet children(avatar)}
|
{#snippet children(avatar)}
|
||||||
<img {...avatar.image} alt="Your avatar" class="size-10 rounded-full" />
|
<img {...avatar.image} alt="Your avatar" class="size-10 rounded-full" />
|
||||||
|
|
@ -409,6 +411,13 @@
|
||||||
<Sidebar.Trigger class="fixed top-3 left-2 z-50">
|
<Sidebar.Trigger class="fixed top-3 left-2 z-50">
|
||||||
<PanelLeftIcon />
|
<PanelLeftIcon />
|
||||||
</Sidebar.Trigger>
|
</Sidebar.Trigger>
|
||||||
|
<!-- header -->
|
||||||
|
<div class="bg-sidebar fixed top-0 right-0 z-50 hidden rounded-bl-lg p-1 md:flex">
|
||||||
|
<Button variant="ghost" size="icon" class="size-8" href="/account">
|
||||||
|
<Settings2Icon/>
|
||||||
|
</Button>
|
||||||
|
<LightSwitch variant="ghost" class="size-8"/>
|
||||||
|
</div>
|
||||||
<div class="relative">
|
<div class="relative">
|
||||||
<div bind:this={conversationList} class="h-screen overflow-y-auto">
|
<div bind:this={conversationList} class="h-screen overflow-y-auto">
|
||||||
<div
|
<div
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue