mirror of
https://github.com/movie-web/native-app.git
synced 2025-09-13 18:13:25 +00:00
add switch theme, remove unneeded search bar context
This commit is contained in:
27
apps/expo/src/components/ui/Switch.tsx
Normal file
27
apps/expo/src/components/ui/Switch.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
import type { SwitchProps } 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: any) => {
|
||||
return <Switch.Thumb animation="quicker" {...props} />;
|
||||
};
|
||||
|
||||
MWSwitch.Thumb = MWSwitchThumb;
|
||||
|
||||
export { MWSwitch };
|
Reference in New Issue
Block a user