| 1 | import { Platform, Switch } from "react-native"; |
| 2 | |
| 3 | import { MaterialSwitch } from "./MaterialSwitch"; |
| 4 | import type { ThemedSwitchProps } from "./MaterialSwitch.types"; |
| 5 | |
| 6 | export type { ThemedSwitchProps } from "./MaterialSwitch.types"; |
| 7 | |
| 8 | export 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 | ); |
| 21 | } |