Default to light mode
This commit is contained in:
parent
ce1c4dd488
commit
52c7df8a15
17 changed files with 35 additions and 25 deletions
|
|
@ -47,6 +47,7 @@
|
|||
"@capacitor/keyboard": "^7.0.0",
|
||||
"@capacitor/preferences": "^7.0.2",
|
||||
"@capacitor/push-notifications": "^7.0.1",
|
||||
"@capawesome/capacitor-android-dark-mode-support": "^7.0.0",
|
||||
"@capawesome/capacitor-badge": "^7.0.1",
|
||||
"@getalby/sdk": "^5.1.0",
|
||||
"@poppanator/sveltekit-svg": "^4.2.1",
|
||||
|
|
|
|||
BIN
pnpm-lock.yaml
BIN
pnpm-lock.yaml
Binary file not shown.
|
|
@ -23,7 +23,7 @@
|
|||
<p class="text-center">The chat app built for self-hosted communities.</p>
|
||||
</div>
|
||||
<Button onclick={logIn}>
|
||||
<CardButton class="!btn-primary">
|
||||
<CardButton class="btn-primary">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={Login} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
@ -35,7 +35,7 @@
|
|||
{/snippet}
|
||||
</CardButton>
|
||||
</Button>
|
||||
<Button onclick={signUp}>
|
||||
<Button onclick={signUp} class="dark:btn-neutral">
|
||||
<CardButton>
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={AddCircle} size={7} /></div>
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
|
||||
<div class="column menu gap-2">
|
||||
<Link replaceState href="/settings/profile">
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={UserRounded} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
@ -32,7 +32,7 @@
|
|||
</CardButton>
|
||||
</Link>
|
||||
<Link replaceState href="/settings/alerts">
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={Bell} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
</CardButton>
|
||||
</Link>
|
||||
<Link replaceState href="/settings/wallet">
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={Wallet} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
</CardButton>
|
||||
</Link>
|
||||
<Link replaceState href="/settings/relays">
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={Server} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
@ -71,7 +71,7 @@
|
|||
</CardButton>
|
||||
</Link>
|
||||
<Link replaceState href="/settings/content">
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={Settings} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
@ -84,7 +84,7 @@
|
|||
</CardButton>
|
||||
</Link>
|
||||
<Link replaceState href="/settings/about">
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={Code2} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@
|
|||
<Divider />
|
||||
{/if}
|
||||
<Button onclick={addSpace}>
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={Login} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
</script>
|
||||
|
||||
<Link replaceState href={path}>
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><SpaceAvatar {url} /></div>
|
||||
{/snippet}
|
||||
|
|
|
|||
|
|
@ -26,7 +26,7 @@
|
|||
{/snippet}
|
||||
</ModalHeader>
|
||||
<Link href="/discover">
|
||||
<CardButton class="!btn-primary">
|
||||
<CardButton class="btn-primary">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={Compass} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
@ -39,7 +39,7 @@
|
|||
</CardButton>
|
||||
</Link>
|
||||
<Button onclick={startJoin}>
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={Login} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
@ -52,7 +52,7 @@
|
|||
</CardButton>
|
||||
</Button>
|
||||
<Button onclick={startCreate}>
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={AddCircle} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@ import {
|
|||
LOCALE,
|
||||
parseJson,
|
||||
fromPairs,
|
||||
last,
|
||||
} from "@welshman/lib"
|
||||
import {decrypt} from "@welshman/signer"
|
||||
import type {Feed} from "@welshman/feeds"
|
||||
|
|
@ -314,8 +315,12 @@ export const checkRelayAuth = async (url: string) => {
|
|||
|
||||
// Only raise an error if it's not a timeout.
|
||||
// If it is, odds are the problem is with our signer, not the relay
|
||||
if (!okStatuses.includes(socket.auth.status) && socket.auth.details) {
|
||||
return `Failed to authenticate (${socket.auth.details})`
|
||||
if (!okStatuses.includes(socket.auth.status)) {
|
||||
if (socket.auth.details) {
|
||||
return `Failed to authenticate (${socket.auth.details})`
|
||||
} else {
|
||||
return `Failed to authenticate (${last(socket.auth.status.split(":"))})`
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ import {
|
|||
tryCatch,
|
||||
} from "@welshman/lib"
|
||||
import type {Socket} from "@welshman/net"
|
||||
import {Pool, load, AuthStateEvent, SocketEvent, netContext} from "@welshman/net"
|
||||
import {Pool, load, AuthStateEvent, AuthStatus, SocketEvent, netContext} from "@welshman/net"
|
||||
import {
|
||||
collection,
|
||||
custom,
|
||||
|
|
@ -815,7 +815,7 @@ export const deriveRelayAuthError = (url: string, claim = "") => {
|
|||
return derived(
|
||||
[relaysMostlyRestricted, deriveSocket(url)],
|
||||
([$relaysMostlyRestricted, $socket]) => {
|
||||
if ($socket.auth.details) {
|
||||
if ($socket.auth.status === AuthStatus.Forbidden && $socket.auth.details) {
|
||||
return stripPrefix($socket.auth.details)
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,6 +3,6 @@ import {synced} from "@welshman/store"
|
|||
|
||||
export const theme = synced({
|
||||
key: "theme",
|
||||
defaultValue: "dark",
|
||||
defaultValue: window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light",
|
||||
storage: preferencesStorageProvider,
|
||||
})
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
const {...props}: Props = $props()
|
||||
</script>
|
||||
|
||||
<div class="btn btn-neutral flex h-[unset] w-full flex-nowrap py-4 text-left {props.class}">
|
||||
<div class="btn flex h-[unset] w-full flex-nowrap py-4 text-left {props.class}">
|
||||
<div class="flex flex-grow flex-row items-start gap-1 sm:pl-2">
|
||||
<div class="flex h-14 w-12 flex-shrink-0 items-center">
|
||||
{@render props.icon?.()}
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@
|
|||
<div class="center fixed inset-0 z-modal">
|
||||
<button
|
||||
aria-label="Close dialog"
|
||||
class="absolute inset-0 cursor-pointer bg-black opacity-75"
|
||||
class="absolute inset-0 cursor-pointer bg-[#ccc] opacity-75 dark:bg-black"
|
||||
transition:fade={{duration: 300}}
|
||||
onclick={onClose}>
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -126,6 +126,7 @@
|
|||
Object.assign(window, {
|
||||
get,
|
||||
nip19,
|
||||
theme,
|
||||
...lib,
|
||||
...welshmanSigner,
|
||||
...router,
|
||||
|
|
|
|||
|
|
@ -91,7 +91,7 @@
|
|||
</label>
|
||||
{#each relaySearch.searchOptions(term).slice(0, limit) as relay (relay.url)}
|
||||
<Button
|
||||
class="card2 bg-alt shadow-xl transition-all hover:shadow-2xl hover:brightness-[1.1]"
|
||||
class="card2 bg-alt shadow-xl transition-all hover:shadow-2xl hover:dark:brightness-[1.1]"
|
||||
onclick={() => openSpace(relay.url)}>
|
||||
<RelaySummary url={relay.url} />
|
||||
</Button>
|
||||
|
|
|
|||
|
|
@ -32,7 +32,7 @@
|
|||
<h1 class="mb-4 text-center text-5xl font-bold uppercase">{PLATFORM_NAME}</h1>
|
||||
<div class="col-3">
|
||||
<Button onclick={addSpace}>
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={AddCircle} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
@ -45,7 +45,7 @@
|
|||
</CardButton>
|
||||
</Button>
|
||||
<Link href="/discover">
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={Compass} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
@ -58,7 +58,7 @@
|
|||
</CardButton>
|
||||
</Link>
|
||||
<Button onclick={openChat}>
|
||||
<CardButton>
|
||||
<CardButton class="dark:btn-neutral">
|
||||
{#snippet icon()}
|
||||
<div><Icon icon={ChatRound} size={7} /></div>
|
||||
{/snippet}
|
||||
|
|
|
|||
|
|
@ -61,7 +61,9 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Button class="center btn btn-circle btn-neutral -mr-4 -mt-4 h-12 w-12" onclick={startEdit}>
|
||||
<Button
|
||||
class="center btn btn-circle -mr-4 -mt-4 h-12 w-12 dark:btn-neutral"
|
||||
onclick={startEdit}>
|
||||
<Icon icon={PenNewSquare} />
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -8,6 +8,7 @@ config({path: ".env.template"})
|
|||
/** @type {import('tailwindcss').Config} */
|
||||
export default {
|
||||
content: ["./src/**/*.{html,js,svelte,ts}"],
|
||||
darkMode: ['selector', '[data-theme="dark"]'],
|
||||
theme: {
|
||||
extend: {},
|
||||
zIndex: {
|
||||
|
|
|
|||
Loading…
Reference in a new issue