Skip to content
Source
Sign inSign up

ThemedSwitch.tsx

21 lines599 Bytes

1import { Platform, Switch } from "react-native";
2​
3import { NativeSwitch } from "./NativeSwitch";
4import type { ThemedSwitchProps } from "./NativeSwitch.types";
5​
6export type { ThemedSwitchProps } from "./NativeSwitch.types";
7​
8export function ThemedSwitch(props: ThemedSwitchProps) {
9 if (Platform.OS === "android") {
10 return <NativeSwitch {...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 );