Move theme button to side nav

This commit is contained in:
Jonathan Staab 2023-06-13 13:59:08 -07:00
parent 249e99806e
commit 8f96398419
3 changed files with 10 additions and 4 deletions

View File

@ -1,5 +1,6 @@
# Current
- [ ] Fix content spacing
- [ ] List detail pages with follow all and add all to list
- [ ] Use vida to stream development
- [ ] Fix connection management stuff. Have GPT help

View File

@ -1,7 +1,7 @@
<script lang="ts">
import cx from "classnames"
import {displayPerson} from "src/util/nostr"
import {installPrompt} from "src/partials/state"
import {theme, installPrompt} from "src/partials/state"
import user from "src/agent/user"
import pool from "src/agent/pool"
import {routes, menuIsOpen} from "src/app/state"
@ -11,6 +11,8 @@
const {profile, canPublish} = user
const toggleTheme = () => theme.update(t => (t === "dark" ? "light" : "dark"))
const install = () => {
$installPrompt.prompt()
@ -109,6 +111,11 @@
<i class="fa fa-gear mr-2" /> Settings
</a>
</li>
<li
class="block cursor-pointer px-4 py-2 transition-all hover:bg-accent hover:text-white"
on:click={toggleTheme}>
<i class="fa fa-lightbulb mr-2" /> Theme
</li>
<li class="cursor-pointer">
<a class="block px-4 py-2 transition-all hover:bg-accent hover:text-white" href="/logout">
<i class="fa fa-right-from-bracket mr-2" /> Logout

View File

@ -1,13 +1,12 @@
<script lang="ts">
import {onMount} from "svelte"
import {theme, appName} from "src/partials/state"
import {appName} from "src/partials/state"
import Anchor from "src/partials/Anchor.svelte"
import {menuIsOpen} from "src/app/state"
import {newNotifications} from "src/app/state"
const logoUrl = import.meta.env.VITE_LOGO_URL || "/images/logo.png"
const toggleMenu = () => menuIsOpen.update(x => !x)
const toggleTheme = () => theme.update(t => (t === "dark" ? "light" : "dark"))
onMount(() => {
document.querySelector("html").addEventListener("click", e => {
@ -31,7 +30,6 @@
<img alt="Coracle Logo" src={logoUrl} class="w-8" />
<h1 class="staatliches text-3xl">{appName}</h1>
</Anchor>
<i class="fa fa-lightbulb -m-4 cursor-pointer p-4 text-lg" on:click={toggleTheme} />
</div>
{#if $newNotifications}
<div class="absolute top-4 left-12 h-2 w-2 rounded bg-accent lg:hidden" />