import { Text } from "preact-i18n"; import styles from "./Panes.module.scss"; import { dispatch } from "../../../redux"; import Checkbox from "../../../components/ui/Checkbox"; import { connectState } from "../../../redux/connector"; import { SyncKeys, SyncOptions } from "../../../redux/reducers/sync"; interface Props { options?: SyncOptions; } export function Component(props: Props) { return (

{ ([ ['appearance', 'appearance.title'], ['theme', 'appearance.theme'], ['locale', 'language.title'] // notifications sync is always-on ] as [ SyncKeys, string ][]).map( ([ key, title ]) => } onChange={enabled => dispatch({ type: enabled ? 'SYNC_ENABLE_KEY' : 'SYNC_DISABLE_KEY', key }) } > ) }
); } export const Sync = connectState( Component, state => { return { options: state.sync }; } );