Browse Source

large text is default setting

imwald
Silberengel 2 weeks ago
parent
commit
e8bded89e6
  1. 2
      src/constants.ts
  2. 3
      src/pages/secondary/GeneralSettingsPage/index.tsx
  3. 5
      src/services/local-storage.service.ts

2
src/constants.ts

@ -424,6 +424,8 @@ export const FONT_SIZE = {
LARGE: 'large' LARGE: 'large'
} as const } as const
export const DEFAULT_FONT_SIZE = FONT_SIZE.LARGE
/** /**
* Random public relays (from NIP-66 lively list; write-tested monitors preferred) merged into the * Random public relays (from NIP-66 lively list; write-tested monitors preferred) merged into the
* publish relay picker. More candidates improve odds some accept open writes. * publish relay picker. More candidates improve odds some accept open writes.

3
src/pages/secondary/GeneralSettingsPage/index.tsx

@ -3,6 +3,7 @@ import { Label } from '@/components/ui/label'
import { Select, SelectContent, SelectItem, SelectTrigger } from '@/components/ui/select' import { Select, SelectContent, SelectItem, SelectTrigger } from '@/components/ui/select'
import { Switch } from '@/components/ui/switch' import { Switch } from '@/components/ui/switch'
import { import {
DEFAULT_FONT_SIZE,
FONT_SIZE, FONT_SIZE,
MEDIA_AUTO_LOAD_POLICY, MEDIA_AUTO_LOAD_POLICY,
NOTIFICATION_LIST_STYLE, NOTIFICATION_LIST_STYLE,
@ -111,7 +112,7 @@ const GeneralSettingsPage = forwardRef(({ index, hideTitlebar = false }: { index
<Label htmlFor="font-size" className="text-base font-normal"> <Label htmlFor="font-size" className="text-base font-normal">
{t('Font size')} {t('Font size')}
</Label> </Label>
<Select defaultValue={FONT_SIZE.MEDIUM} value={fontSize} onValueChange={setFontSize}> <Select defaultValue={DEFAULT_FONT_SIZE} value={fontSize} onValueChange={setFontSize}>
<SelectTrigger id="font-size" className="w-48"> <SelectTrigger id="font-size" className="w-48">
<SelectValue /> <SelectValue />
</SelectTrigger> </SelectTrigger>

5
src/services/local-storage.service.ts

@ -1,4 +1,5 @@
import { import {
DEFAULT_FONT_SIZE,
DEFAULT_NIP_96_SERVICE, DEFAULT_NIP_96_SERVICE,
ExtendedKind, ExtendedKind,
MEDIA_AUTO_LOAD_POLICY, MEDIA_AUTO_LOAD_POLICY,
@ -89,7 +90,7 @@ class LocalStorageService {
private themeSetting: TThemeSetting = 'system' private themeSetting: TThemeSetting = 'system'
private theme: TTheme = 'light' private theme: TTheme = 'light'
private addClientTag: boolean = true private addClientTag: boolean = true
private fontSize: TFontSize = 'medium' private fontSize: TFontSize = DEFAULT_FONT_SIZE
private accounts: TAccount[] = [] private accounts: TAccount[] = []
private currentAccount: TAccount | null = null private currentAccount: TAccount | null = null
private noteListMode: TNoteListMode = 'posts' private noteListMode: TNoteListMode = 'posts'
@ -139,7 +140,7 @@ class LocalStorageService {
const addClientTagStr = window.localStorage.getItem(StorageKey.ADD_CLIENT_TAG) const addClientTagStr = window.localStorage.getItem(StorageKey.ADD_CLIENT_TAG)
this.addClientTag = addClientTagStr === null ? true : addClientTagStr === 'true' this.addClientTag = addClientTagStr === null ? true : addClientTagStr === 'true'
this.fontSize = this.fontSize =
(window.localStorage.getItem(StorageKey.FONT_SIZE) as TFontSize) ?? 'medium' (window.localStorage.getItem(StorageKey.FONT_SIZE) as TFontSize) ?? DEFAULT_FONT_SIZE
const accountsStr = window.localStorage.getItem(StorageKey.ACCOUNTS) const accountsStr = window.localStorage.getItem(StorageKey.ACCOUNTS)
this.accounts = accountsStr ? JSON.parse(accountsStr) : [] this.accounts = accountsStr ? JSON.parse(accountsStr) : []
const currentAccountStr = window.localStorage.getItem(StorageKey.CURRENT_ACCOUNT) const currentAccountStr = window.localStorage.getItem(StorageKey.CURRENT_ACCOUNT)

Loading…
Cancel
Save