Default to light mode
This commit is contained in:
@@ -47,6 +47,7 @@
|
|||||||
"@capacitor/keyboard": "^7.0.0",
|
"@capacitor/keyboard": "^7.0.0",
|
||||||
"@capacitor/preferences": "^7.0.2",
|
"@capacitor/preferences": "^7.0.2",
|
||||||
"@capacitor/push-notifications": "^7.0.1",
|
"@capacitor/push-notifications": "^7.0.1",
|
||||||
|
"@capawesome/capacitor-android-dark-mode-support": "^7.0.0",
|
||||||
"@capawesome/capacitor-badge": "^7.0.1",
|
"@capawesome/capacitor-badge": "^7.0.1",
|
||||||
"@getalby/sdk": "^5.1.0",
|
"@getalby/sdk": "^5.1.0",
|
||||||
"@poppanator/sveltekit-svg": "^4.2.1",
|
"@poppanator/sveltekit-svg": "^4.2.1",
|
||||||
|
|||||||
Generated
+12
@@ -35,6 +35,9 @@ importers:
|
|||||||
'@capacitor/push-notifications':
|
'@capacitor/push-notifications':
|
||||||
specifier: ^7.0.1
|
specifier: ^7.0.1
|
||||||
version: 7.0.1(@capacitor/core@7.2.0)
|
version: 7.0.1(@capacitor/core@7.2.0)
|
||||||
|
'@capawesome/capacitor-android-dark-mode-support':
|
||||||
|
specifier: ^7.0.0
|
||||||
|
version: 7.0.0(@capacitor/core@7.2.0)
|
||||||
'@capawesome/capacitor-badge':
|
'@capawesome/capacitor-badge':
|
||||||
specifier: ^7.0.1
|
specifier: ^7.0.1
|
||||||
version: 7.0.1(@capacitor/core@7.2.0)
|
version: 7.0.1(@capacitor/core@7.2.0)
|
||||||
@@ -771,6 +774,11 @@ packages:
|
|||||||
peerDependencies:
|
peerDependencies:
|
||||||
'@capacitor/core': '>=7.0.0'
|
'@capacitor/core': '>=7.0.0'
|
||||||
|
|
||||||
|
'@capawesome/capacitor-android-dark-mode-support@7.0.0':
|
||||||
|
resolution: {integrity: sha512-xLa988v9MEnFZj7Aje3v2vvYbs5U3zk8vaO24OioXUV1ZPjGy4R2VkdoKG8fTsSYRdF6s4/8DpCuos8JLJqpjw==}
|
||||||
|
peerDependencies:
|
||||||
|
'@capacitor/core': '>=7.0.0'
|
||||||
|
|
||||||
'@capawesome/capacitor-badge@7.0.1':
|
'@capawesome/capacitor-badge@7.0.1':
|
||||||
resolution: {integrity: sha512-jhVieRRVLgGO1NU7PW8uWZmf3WD4IsYUlkrJ82KuoRgLFx1tbJGwHU1ro0sUJmEwfLO9vldhBnJJ/J5nHrjbQQ==}
|
resolution: {integrity: sha512-jhVieRRVLgGO1NU7PW8uWZmf3WD4IsYUlkrJ82KuoRgLFx1tbJGwHU1ro0sUJmEwfLO9vldhBnJJ/J5nHrjbQQ==}
|
||||||
peerDependencies:
|
peerDependencies:
|
||||||
@@ -5609,6 +5617,10 @@ snapshots:
|
|||||||
dependencies:
|
dependencies:
|
||||||
'@capacitor/core': 7.2.0
|
'@capacitor/core': 7.2.0
|
||||||
|
|
||||||
|
'@capawesome/capacitor-android-dark-mode-support@7.0.0(@capacitor/core@7.2.0)':
|
||||||
|
dependencies:
|
||||||
|
'@capacitor/core': 7.2.0
|
||||||
|
|
||||||
'@capawesome/capacitor-badge@7.0.1(@capacitor/core@7.2.0)':
|
'@capawesome/capacitor-badge@7.0.1(@capacitor/core@7.2.0)':
|
||||||
dependencies:
|
dependencies:
|
||||||
'@capacitor/core': 7.2.0
|
'@capacitor/core': 7.2.0
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<p class="text-center">The chat app built for self-hosted communities.</p>
|
<p class="text-center">The chat app built for self-hosted communities.</p>
|
||||||
</div>
|
</div>
|
||||||
<Button onclick={logIn}>
|
<Button onclick={logIn}>
|
||||||
<CardButton class="!btn-primary">
|
<CardButton class="btn-primary">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={Login} size={7} /></div>
|
<div><Icon icon={Login} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -35,7 +35,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
</CardButton>
|
</CardButton>
|
||||||
</Button>
|
</Button>
|
||||||
<Button onclick={signUp}>
|
<Button onclick={signUp} class="dark:btn-neutral">
|
||||||
<CardButton>
|
<CardButton>
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={AddCircle} size={7} /></div>
|
<div><Icon icon={AddCircle} size={7} /></div>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
<div class="column menu gap-2">
|
<div class="column menu gap-2">
|
||||||
<Link replaceState href="/settings/profile">
|
<Link replaceState href="/settings/profile">
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={UserRounded} size={7} /></div>
|
<div><Icon icon={UserRounded} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
</CardButton>
|
</CardButton>
|
||||||
</Link>
|
</Link>
|
||||||
<Link replaceState href="/settings/alerts">
|
<Link replaceState href="/settings/alerts">
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={Bell} size={7} /></div>
|
<div><Icon icon={Bell} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
</CardButton>
|
</CardButton>
|
||||||
</Link>
|
</Link>
|
||||||
<Link replaceState href="/settings/wallet">
|
<Link replaceState href="/settings/wallet">
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={Wallet} size={7} /></div>
|
<div><Icon icon={Wallet} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
</CardButton>
|
</CardButton>
|
||||||
</Link>
|
</Link>
|
||||||
<Link replaceState href="/settings/relays">
|
<Link replaceState href="/settings/relays">
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={Server} size={7} /></div>
|
<div><Icon icon={Server} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -71,7 +71,7 @@
|
|||||||
</CardButton>
|
</CardButton>
|
||||||
</Link>
|
</Link>
|
||||||
<Link replaceState href="/settings/content">
|
<Link replaceState href="/settings/content">
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={Settings} size={7} /></div>
|
<div><Icon icon={Settings} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
</CardButton>
|
</CardButton>
|
||||||
</Link>
|
</Link>
|
||||||
<Link replaceState href="/settings/about">
|
<Link replaceState href="/settings/about">
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={Code2} size={7} /></div>
|
<div><Icon icon={Code2} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
<Divider />
|
<Divider />
|
||||||
{/if}
|
{/if}
|
||||||
<Button onclick={addSpace}>
|
<Button onclick={addSpace}>
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={Login} size={7} /></div>
|
<div><Icon icon={Login} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Link replaceState href={path}>
|
<Link replaceState href={path}>
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><SpaceAvatar {url} /></div>
|
<div><SpaceAvatar {url} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
{/snippet}
|
{/snippet}
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
<Link href="/discover">
|
<Link href="/discover">
|
||||||
<CardButton class="!btn-primary">
|
<CardButton class="btn-primary">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={Compass} size={7} /></div>
|
<div><Icon icon={Compass} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -39,7 +39,7 @@
|
|||||||
</CardButton>
|
</CardButton>
|
||||||
</Link>
|
</Link>
|
||||||
<Button onclick={startJoin}>
|
<Button onclick={startJoin}>
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={Login} size={7} /></div>
|
<div><Icon icon={Login} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -52,7 +52,7 @@
|
|||||||
</CardButton>
|
</CardButton>
|
||||||
</Button>
|
</Button>
|
||||||
<Button onclick={startCreate}>
|
<Button onclick={startCreate}>
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={AddCircle} size={7} /></div>
|
<div><Icon icon={AddCircle} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
LOCALE,
|
LOCALE,
|
||||||
parseJson,
|
parseJson,
|
||||||
fromPairs,
|
fromPairs,
|
||||||
|
last,
|
||||||
} from "@welshman/lib"
|
} from "@welshman/lib"
|
||||||
import {decrypt} from "@welshman/signer"
|
import {decrypt} from "@welshman/signer"
|
||||||
import type {Feed} from "@welshman/feeds"
|
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.
|
// 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 it is, odds are the problem is with our signer, not the relay
|
||||||
if (!okStatuses.includes(socket.auth.status) && socket.auth.details) {
|
if (!okStatuses.includes(socket.auth.status)) {
|
||||||
return `Failed to authenticate (${socket.auth.details})`
|
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,
|
tryCatch,
|
||||||
} from "@welshman/lib"
|
} from "@welshman/lib"
|
||||||
import type {Socket} from "@welshman/net"
|
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 {
|
import {
|
||||||
collection,
|
collection,
|
||||||
custom,
|
custom,
|
||||||
@@ -815,7 +815,7 @@ export const deriveRelayAuthError = (url: string, claim = "") => {
|
|||||||
return derived(
|
return derived(
|
||||||
[relaysMostlyRestricted, deriveSocket(url)],
|
[relaysMostlyRestricted, deriveSocket(url)],
|
||||||
([$relaysMostlyRestricted, $socket]) => {
|
([$relaysMostlyRestricted, $socket]) => {
|
||||||
if ($socket.auth.details) {
|
if ($socket.auth.status === AuthStatus.Forbidden && $socket.auth.details) {
|
||||||
return stripPrefix($socket.auth.details)
|
return stripPrefix($socket.auth.details)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ import {synced} from "@welshman/store"
|
|||||||
|
|
||||||
export const theme = synced({
|
export const theme = synced({
|
||||||
key: "theme",
|
key: "theme",
|
||||||
defaultValue: "dark",
|
defaultValue: window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light",
|
||||||
storage: preferencesStorageProvider,
|
storage: preferencesStorageProvider,
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -11,7 +11,7 @@
|
|||||||
const {...props}: Props = $props()
|
const {...props}: Props = $props()
|
||||||
</script>
|
</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 flex-grow flex-row items-start gap-1 sm:pl-2">
|
||||||
<div class="flex h-14 w-12 flex-shrink-0 items-center">
|
<div class="flex h-14 w-12 flex-shrink-0 items-center">
|
||||||
{@render props.icon?.()}
|
{@render props.icon?.()}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
<div class="center fixed inset-0 z-modal">
|
<div class="center fixed inset-0 z-modal">
|
||||||
<button
|
<button
|
||||||
aria-label="Close dialog"
|
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}}
|
transition:fade={{duration: 300}}
|
||||||
onclick={onClose}>
|
onclick={onClose}>
|
||||||
</button>
|
</button>
|
||||||
|
|||||||
@@ -126,6 +126,7 @@
|
|||||||
Object.assign(window, {
|
Object.assign(window, {
|
||||||
get,
|
get,
|
||||||
nip19,
|
nip19,
|
||||||
|
theme,
|
||||||
...lib,
|
...lib,
|
||||||
...welshmanSigner,
|
...welshmanSigner,
|
||||||
...router,
|
...router,
|
||||||
|
|||||||
@@ -91,7 +91,7 @@
|
|||||||
</label>
|
</label>
|
||||||
{#each relaySearch.searchOptions(term).slice(0, limit) as relay (relay.url)}
|
{#each relaySearch.searchOptions(term).slice(0, limit) as relay (relay.url)}
|
||||||
<Button
|
<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)}>
|
onclick={() => openSpace(relay.url)}>
|
||||||
<RelaySummary url={relay.url} />
|
<RelaySummary url={relay.url} />
|
||||||
</Button>
|
</Button>
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
<h1 class="mb-4 text-center text-5xl font-bold uppercase">{PLATFORM_NAME}</h1>
|
<h1 class="mb-4 text-center text-5xl font-bold uppercase">{PLATFORM_NAME}</h1>
|
||||||
<div class="col-3">
|
<div class="col-3">
|
||||||
<Button onclick={addSpace}>
|
<Button onclick={addSpace}>
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={AddCircle} size={7} /></div>
|
<div><Icon icon={AddCircle} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -45,7 +45,7 @@
|
|||||||
</CardButton>
|
</CardButton>
|
||||||
</Button>
|
</Button>
|
||||||
<Link href="/discover">
|
<Link href="/discover">
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={Compass} size={7} /></div>
|
<div><Icon icon={Compass} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
@@ -58,7 +58,7 @@
|
|||||||
</CardButton>
|
</CardButton>
|
||||||
</Link>
|
</Link>
|
||||||
<Button onclick={openChat}>
|
<Button onclick={openChat}>
|
||||||
<CardButton>
|
<CardButton class="dark:btn-neutral">
|
||||||
{#snippet icon()}
|
{#snippet icon()}
|
||||||
<div><Icon icon={ChatRound} size={7} /></div>
|
<div><Icon icon={ChatRound} size={7} /></div>
|
||||||
{/snippet}
|
{/snippet}
|
||||||
|
|||||||
@@ -61,7 +61,9 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</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} />
|
<Icon icon={PenNewSquare} />
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ config({path: ".env.template"})
|
|||||||
/** @type {import('tailwindcss').Config} */
|
/** @type {import('tailwindcss').Config} */
|
||||||
export default {
|
export default {
|
||||||
content: ["./src/**/*.{html,js,svelte,ts}"],
|
content: ["./src/**/*.{html,js,svelte,ts}"],
|
||||||
|
darkMode: ['selector', '[data-theme="dark"]'],
|
||||||
theme: {
|
theme: {
|
||||||
extend: {},
|
extend: {},
|
||||||
zIndex: {
|
zIndex: {
|
||||||
|
|||||||
Reference in New Issue
Block a user