Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

ThemedSwitch.tsx

21 lines609 Bytes

1import { Platform, Switch } from "react-native";
2​
3import { MaterialSwitch } from "./MaterialSwitch";
4import type { ThemedSwitchProps } from "./MaterialSwitch.types";
5​
6export type { ThemedSwitchProps } from "./MaterialSwitch.types";
7​
8export function ThemedSwitch(props: ThemedSwitchProps) {
9 if (Platform.OS === "android") {
10 return <MaterialSwitch {...props} />;
11 }
12​
13 return (
14 <Switch
15 {...props}
16 ios_backgroundColorClassName="accent-switch-inactive-track"
17 trackColorOffClassName="accent-switch-inactive-track"
18 trackColorOnClassName="accent-switch-active-track"
19 />
20 );