Skip to content

Commit

Permalink
fix(app): change to dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
Swepool committed Jul 18, 2024
1 parent 70abe63 commit bbf331e
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
27 changes: 14 additions & 13 deletions app/src/lib/components/connect/connect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,15 @@ import { Button } from "$lib/components/ui/button"
import * as Avatar from "$lib/components/ui/avatar"
import WalletIcon from "virtual:icons/lucide/wallet"
import { Separator } from "$lib/components/ui/separator"
import ThemeSwitch from "$lib/components/header/theme-switch.svelte"
import { sepoliaStore, evmWalletsInformation } from "$lib/wallet/evm/index.ts"
import { cosmosStore, cosmosWalletsInformation } from "$lib/wallet/cosmos/index.ts"
import { Switch } from "$lib/components/ui/switch"
import { Label } from "$lib/components/ui/label"
import { showUnsupported } from "$lib/stores/user.ts"
import Sun from "virtual:icons/lucide/sun"
import Moon from "virtual:icons/lucide/moon"
import { setMode, toggleMode } from "mode-watcher"
import * as Popover from "$lib/components/ui/popover"
import { setMode } from "mode-watcher"
import * as DropdownMenu from "$lib/components/ui/dropdown-menu"
let buttonText: string
Expand Down Expand Up @@ -102,9 +101,9 @@ $: if ($navigating) sheetOpen = false
<Switch bind:checked={$showUnsupported} id="unsupported-assets"/>
<Label for="unsupported-assets">Show unverified assets</Label>
</div>
<Popover.Root>
<Popover.Trigger>
<Button variant="default" size="icon" class="hover:text-black hover:bg-accent">
<DropdownMenu.Root>
<DropdownMenu.Trigger asChild let:builder>
<Button builders={[builder]} variant="default" size="icon" class="hover:text-black hover:bg-accent">
<Sun
class="h-[1.2rem] w-[1.2rem] rotate-0 scale-100 transition-all dark:-rotate-90 dark:scale-0"
/>
Expand All @@ -113,13 +112,15 @@ $: if ($navigating) sheetOpen = false
/>
<span class="sr-only">Toggle theme</span>
</Button>
</Popover.Trigger>
<Popover.Content class="rounded-none bg-secondary w-fit">
<Button on:click={() => setMode('system')} size="sm">System</Button>
<Button on:click={() => setMode('dark')} size="sm">Dark</Button>
<Button on:click={() => setMode('light')} size="sm">Light</Button>
</Popover.Content>
</Popover.Root>
</DropdownMenu.Trigger>
<DropdownMenu.Content class="w-fit rounded-none bg-secondary">
<DropdownMenu.Group>
<DropdownMenu.Item on:click={() => setMode('system')} class="cursor-pointer">System</DropdownMenu.Item>
<DropdownMenu.Item on:click={() => setMode('dark')} class="cursor-pointer">Dark</DropdownMenu.Item>
<DropdownMenu.Item on:click={() => setMode('light')} class="cursor-pointer">Light</DropdownMenu.Item>
</DropdownMenu.Group>
</DropdownMenu.Content>
</DropdownMenu.Root>
</div>
</Sheet.Content>
</Sheet.Root>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export { className as class }

<DropdownMenuPrimitive.Item
class={cn(
"relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground data-[disabled]:opacity-50",
"text-primary relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled]:pointer-events-none data-[highlighted]:bg-accent data-[highlighted]:text-accent-foreground dark:data-[highlighted]:text-black data-[disabled]:opacity-50",
inset && "pl-8",
className
)}
Expand Down

0 comments on commit bbf331e

Please sign in to comment.