refactor: move notification list style setting to appearance page
This commit is contained in:
parent
dbee10361b
commit
cb46e7f3d5
2 changed files with 32 additions and 33 deletions
|
|
@ -1,12 +1,11 @@
|
|||
import { Label } from '@/components/ui/label'
|
||||
import { Select, SelectContent, SelectItem, SelectTrigger } from '@/components/ui/select'
|
||||
import { Switch } from '@/components/ui/switch'
|
||||
import { MEDIA_AUTO_LOAD_POLICY, NOTIFICATION_LIST_STYLE } from '@/constants'
|
||||
import { MEDIA_AUTO_LOAD_POLICY } from '@/constants'
|
||||
import { LocalizedLanguageNames, TLanguage } from '@/i18n'
|
||||
import SecondaryPageLayout from '@/layouts/SecondaryPageLayout'
|
||||
import { cn, isSupportCheckConnectionType } from '@/lib/utils'
|
||||
import { useContentPolicy } from '@/providers/ContentPolicyProvider'
|
||||
import { useUserPreferences } from '@/providers/UserPreferencesProvider'
|
||||
import { useUserTrust } from '@/providers/UserTrustProvider'
|
||||
import { TMediaAutoLoadPolicy } from '@/types'
|
||||
import { SelectValue } from '@radix-ui/react-select'
|
||||
|
|
@ -28,7 +27,6 @@ const GeneralSettingsPage = forwardRef(({ index }: { index?: number }, ref) => {
|
|||
setMediaAutoLoadPolicy
|
||||
} = useContentPolicy()
|
||||
const { hideUntrustedNotes, updateHideUntrustedNotes } = useUserTrust()
|
||||
const { notificationListStyle, updateNotificationListStyle } = useUserPreferences()
|
||||
|
||||
const handleLanguageChange = (value: TLanguage) => {
|
||||
i18n.changeLanguage(value)
|
||||
|
|
@ -55,29 +53,6 @@ const GeneralSettingsPage = forwardRef(({ index }: { index?: number }, ref) => {
|
|||
</SelectContent>
|
||||
</Select>
|
||||
</SettingItem>
|
||||
<SettingItem>
|
||||
<Label htmlFor="notification-list-style" className="text-base font-normal">
|
||||
<div>{t('Notification list style')}</div>
|
||||
<div className="text-muted-foreground">
|
||||
{notificationListStyle === NOTIFICATION_LIST_STYLE.DETAILED
|
||||
? t('See extra info for each notification')
|
||||
: t('See more notifications at a glance')}
|
||||
</div>
|
||||
</Label>
|
||||
<Select
|
||||
defaultValue={NOTIFICATION_LIST_STYLE.DETAILED}
|
||||
value={notificationListStyle}
|
||||
onValueChange={updateNotificationListStyle}
|
||||
>
|
||||
<SelectTrigger id="notification-list-style" className="w-48">
|
||||
<SelectValue />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value={NOTIFICATION_LIST_STYLE.DETAILED}>{t('Detailed')}</SelectItem>
|
||||
<SelectItem value={NOTIFICATION_LIST_STYLE.COMPACT}>{t('Compact')}</SelectItem>
|
||||
</SelectContent>
|
||||
</Select>
|
||||
</SettingItem>
|
||||
<SettingItem>
|
||||
<Label htmlFor="media-auto-load-policy" className="text-base font-normal">
|
||||
{t('Auto-load media')}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue