feat: settings

This commit is contained in:
Fredrik Burmester
2024-08-14 15:04:31 +02:00
parent a76ed9be66
commit 2a34851fc6
5 changed files with 181 additions and 107 deletions

View File

@@ -0,0 +1,20 @@
import { Switch, View } from "react-native";
import { Text } from "../common/Text";
import { useAtom } from "jotai";
import { useSettings } from "@/utils/atoms/settings";
export const SettingToggles: React.FC = () => {
const [settings, updateSettings] = useSettings();
return (
<View className="flex flex-col rounded-xl mb-4 overflow-hidden border-neutral-800 divide-y-2 divide-solid divide-neutral-800 ">
<View className="flex flex-row items-center justify-between bg-neutral-900 p-4">
<Text>Auto rotate</Text>
<Switch
value={settings?.autoRotate}
onValueChange={(value) => updateSettings({ autoRotate: value })}
/>
</View>
</View>
);
};