Browse Source

update app/components/Switch.js

wudebin 6 months ago
parent
commit
ea5927ecd7
1 changed files with 7 additions and 15 deletions
  1. 7 15
      Strides-SPAPP/app/components/Switch.js

+ 7 - 15
Strides-SPAPP/app/components/Switch.js

@@ -3,13 +3,12 @@
  * @邠心vbe on 2023/08/30
  */
 import React from 'react';
-import { Switch, SwitchProps, Text, View } from 'react-native';
-import Animated from 'react-native-reanimated';
+import { Switch } from 'react-native';
 import utils from '../utils/utils';
 
 //const switchStyle = { false: "#B2B2B2", true: colorAccent };
 
-export default SwitchBase = (props, {...SwitchProps}) => {
+export default SwitchBase = (props) => {
   const colors = utils.hexColorToRgb(colorAccent);
   var thumbColor = null;
   var trackColor = { false: "#B2B2B2", true: colorAccent }
@@ -18,17 +17,10 @@ export default SwitchBase = (props, {...SwitchProps}) => {
     trackColor = {false: "#B2B2B2", true: utils.getRgbaColor(colors, 0.3)}
   }
   return (
-    <Animated.View style={ui.flexc}>
-      <Switch
-        {...props}
-        trackColor={trackColor}
-        thumbColor={thumbColor}
-      />
-      {/* <Switch
-        {...props}
-      />
-      <Text style={{color: utils.getRgbaColor(colors, 0.9)}}>■■■</Text>
-      <Text style={{color: utils.getRgbaColor(colors, 0.3)}}>■■■</Text> */}
-    </Animated.View>
+    <Switch
+      {...props}
+      trackColor={trackColor}
+      thumbColor={thumbColor}
+    />
   );
 }