mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
32 lines
1.1 KiB
TypeScript
32 lines
1.1 KiB
TypeScript
|
|
import { t } from "@lingui/macro"
|
||
|
|
import { Select, Stack, Switch } from "@mantine/core"
|
||
|
|
import { changeLanguage, changeScrollSpeed } from "app/slices/user"
|
||
|
|
import { useAppDispatch, useAppSelector } from "app/store"
|
||
|
|
import { locales } from "i18n"
|
||
|
|
|
||
|
|
export function DisplaySettings() {
|
||
|
|
const language = useAppSelector(state => state.user.settings?.language)
|
||
|
|
const scrollSpeed = useAppSelector(state => state.user.settings?.scrollSpeed)
|
||
|
|
const dispatch = useAppDispatch()
|
||
|
|
|
||
|
|
return (
|
||
|
|
<Stack>
|
||
|
|
<Select
|
||
|
|
description={t`Language`}
|
||
|
|
value={language}
|
||
|
|
data={locales.map(l => ({
|
||
|
|
value: l.key,
|
||
|
|
label: l.label,
|
||
|
|
}))}
|
||
|
|
onChange={s => s && dispatch(changeLanguage(s))}
|
||
|
|
/>
|
||
|
|
|
||
|
|
<Switch
|
||
|
|
label={t`Scroll smoothly when navigating between entries`}
|
||
|
|
checked={scrollSpeed ? scrollSpeed > 0 : false}
|
||
|
|
onChange={e => dispatch(changeScrollSpeed(e.currentTarget.checked))}
|
||
|
|
/>
|
||
|
|
</Stack>
|
||
|
|
)
|
||
|
|
}
|