Remove system theme, keep light/dark/neon only
This commit is contained in:
parent
c080a8d1c8
commit
a01f258d4b
7 changed files with 8 additions and 14 deletions
|
|
@ -1,4 +1,4 @@
|
|||
export type Theme = 'light' | 'dark' | 'system' | 'neon';
|
||||
export type Theme = 'light' | 'dark' | 'neon';
|
||||
|
||||
/** Lifecycle of the NIP-46 remote signer. */
|
||||
export type SignerPhase = 'stopped' | 'connecting' | 'connected';
|
||||
|
|
|
|||
|
|
@ -104,12 +104,11 @@ export function SettingsScreen() {
|
|||
>
|
||||
<option value="light">Light</option>
|
||||
<option value="dark">Dark</option>
|
||||
<option value="system">System</option>
|
||||
<option value="neon">Neon</option>
|
||||
</select>
|
||||
<p className="hint">
|
||||
“System” follows your desktop's light or dark preference. “Neon” is a pure-black
|
||||
theme with pink and purple accents.
|
||||
“Light” and “Dark” follow your manual selection. “Neon” is a pure-black theme with
|
||||
pink and purple accents.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -335,16 +335,13 @@ export function useApp(): AppContextValue {
|
|||
return context;
|
||||
}
|
||||
|
||||
/** Apply the requested theme (respecting system preference for `system`). */
|
||||
/** Apply the requested theme. */
|
||||
export function applyTheme(theme: Theme): void {
|
||||
if (theme === 'neon') {
|
||||
document.documentElement.dataset.theme = 'neon';
|
||||
return;
|
||||
}
|
||||
const prefersDark =
|
||||
theme === 'dark' ||
|
||||
(theme === 'system' && window.matchMedia('(prefers-color-scheme: dark)').matches);
|
||||
document.documentElement.dataset.theme = prefersDark ? 'dark' : 'light';
|
||||
document.documentElement.dataset.theme = theme;
|
||||
}
|
||||
|
||||
/** Keep the document theme in sync with settings, watching system changes. */
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ describe('FeedScreen', () => {
|
|||
|
||||
it('disable relays shows an empty state that can navigate to relays', async () => {
|
||||
const settings = {
|
||||
theme: 'system' as const,
|
||||
theme: 'light' as const,
|
||||
confirm_before_publish: true,
|
||||
shorten_npub: true,
|
||||
relays: [
|
||||
|
|
|
|||
|
|
@ -25,7 +25,7 @@ export function makeState(overrides?: Partial<AppState>): AppState {
|
|||
is_active: false,
|
||||
};
|
||||
const settings: Settings = {
|
||||
theme: 'system',
|
||||
theme: 'light',
|
||||
confirm_before_publish: true,
|
||||
shorten_npub: true,
|
||||
relays: [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue