mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 13:03:26 +00:00
28 lines
629 B
TypeScript
28 lines
629 B
TypeScript
import type { SwitchProps, SwitchThumbProps } from "tamagui";
|
|
import { Switch, useTheme } from "tamagui";
|
|
|
|
const MWSwitch = (props: SwitchProps) => {
|
|
const theme = useTheme();
|
|
return (
|
|
<Switch
|
|
native
|
|
nativeProps={{
|
|
trackColor: {
|
|
true: theme.switchActiveTrackColor.val,
|
|
false: theme.switchInactiveTrackColor.val,
|
|
},
|
|
thumbColor: theme.switchThumbColor.val,
|
|
}}
|
|
{...props}
|
|
/>
|
|
);
|
|
};
|
|
|
|
const MWSwitchThumb = (props: SwitchThumbProps) => {
|
|
return <Switch.Thumb animation="bounce" {...props} />;
|
|
};
|
|
|
|
MWSwitch.Thumb = MWSwitchThumb;
|
|
|
|
export { MWSwitch };
|