import type { ReactNode } from "react"; import { Switch } from "../../components/Switch"; import { useWSMutation, useWSQuery } from "../../hooks"; interface BoolSettingProps { label: string; description: ReactNode; value: boolean; onChange: (value: boolean) => void; } const BoolSetting: React.FC = ({ label, description, value, onChange, }) => (

{description}

); const Settings = () => { const { data: settings, refetch } = useWSQuery("user.getSettings", null); const updateSettings = useWSMutation("user.updateSettings"); return (

Settings

You can place a question mark on a tile after placing a flag.
Just right click again on the tile. } value={settings?.placeQuestionMark ?? false} onChange={async (value) => { await updateSettings.mutateAsync({ placeQuestionMark: value }); refetch(); }} /> You can long press on a tile to reveal it. This is useful for touch devices. } value={settings?.longPressOnDesktop ?? false} onChange={async (value) => { await updateSettings.mutateAsync({ longPressOnDesktop: value }); refetch(); }} /> Show an animation when a tile is revealed.} value={settings?.showRevealAnimation ?? true} onChange={async (value) => { await updateSettings.mutateAsync({ showRevealAnimation: value }); refetch(); }} /> Enable or disable sound effects in the game.} value={settings?.soundEnabled ?? true} onChange={async (value) => { await updateSettings.mutateAsync({ soundEnabled: value }); refetch(); }} />
); }; export default Settings;