mirror of
https://github.com/coracle-social/coracle.git
synced 2024-09-19 11:43:35 +00:00
Move theme button to side nav
This commit is contained in:
parent
249e99806e
commit
8f96398419
@ -1,5 +1,6 @@
|
|||||||
# Current
|
# Current
|
||||||
|
|
||||||
|
- [ ] Fix content spacing
|
||||||
- [ ] List detail pages with follow all and add all to list
|
- [ ] List detail pages with follow all and add all to list
|
||||||
- [ ] Use vida to stream development
|
- [ ] Use vida to stream development
|
||||||
- [ ] Fix connection management stuff. Have GPT help
|
- [ ] Fix connection management stuff. Have GPT help
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import cx from "classnames"
|
import cx from "classnames"
|
||||||
import {displayPerson} from "src/util/nostr"
|
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 user from "src/agent/user"
|
||||||
import pool from "src/agent/pool"
|
import pool from "src/agent/pool"
|
||||||
import {routes, menuIsOpen} from "src/app/state"
|
import {routes, menuIsOpen} from "src/app/state"
|
||||||
@ -11,6 +11,8 @@
|
|||||||
|
|
||||||
const {profile, canPublish} = user
|
const {profile, canPublish} = user
|
||||||
|
|
||||||
|
const toggleTheme = () => theme.update(t => (t === "dark" ? "light" : "dark"))
|
||||||
|
|
||||||
const install = () => {
|
const install = () => {
|
||||||
$installPrompt.prompt()
|
$installPrompt.prompt()
|
||||||
|
|
||||||
@ -109,6 +111,11 @@
|
|||||||
<i class="fa fa-gear mr-2" /> Settings
|
<i class="fa fa-gear mr-2" /> Settings
|
||||||
</a>
|
</a>
|
||||||
</li>
|
</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">
|
<li class="cursor-pointer">
|
||||||
<a class="block px-4 py-2 transition-all hover:bg-accent hover:text-white" href="/logout">
|
<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
|
<i class="fa fa-right-from-bracket mr-2" /> Logout
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import {onMount} from "svelte"
|
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 Anchor from "src/partials/Anchor.svelte"
|
||||||
import {menuIsOpen} from "src/app/state"
|
import {menuIsOpen} from "src/app/state"
|
||||||
import {newNotifications} from "src/app/state"
|
import {newNotifications} from "src/app/state"
|
||||||
|
|
||||||
const logoUrl = import.meta.env.VITE_LOGO_URL || "/images/logo.png"
|
const logoUrl = import.meta.env.VITE_LOGO_URL || "/images/logo.png"
|
||||||
const toggleMenu = () => menuIsOpen.update(x => !x)
|
const toggleMenu = () => menuIsOpen.update(x => !x)
|
||||||
const toggleTheme = () => theme.update(t => (t === "dark" ? "light" : "dark"))
|
|
||||||
|
|
||||||
onMount(() => {
|
onMount(() => {
|
||||||
document.querySelector("html").addEventListener("click", e => {
|
document.querySelector("html").addEventListener("click", e => {
|
||||||
@ -31,7 +30,6 @@
|
|||||||
<img alt="Coracle Logo" src={logoUrl} class="w-8" />
|
<img alt="Coracle Logo" src={logoUrl} class="w-8" />
|
||||||
<h1 class="staatliches text-3xl">{appName}</h1>
|
<h1 class="staatliches text-3xl">{appName}</h1>
|
||||||
</Anchor>
|
</Anchor>
|
||||||
<i class="fa fa-lightbulb -m-4 cursor-pointer p-4 text-lg" on:click={toggleTheme} />
|
|
||||||
</div>
|
</div>
|
||||||
{#if $newNotifications}
|
{#if $newNotifications}
|
||||||
<div class="absolute top-4 left-12 h-2 w-2 rounded bg-accent lg:hidden" />
|
<div class="absolute top-4 left-12 h-2 w-2 rounded bg-accent lg:hidden" />
|
||||||
|
Loading…
Reference in New Issue
Block a user