mirror of
https://github.com/Stef-00012/Zipline-Android-App.git
synced 2025-05-11 18:35:58 +02:00
remove useless styles, format with biomejs
This commit is contained in:
parent
626f025e2c
commit
4ff541d05f
89 changed files with 4810 additions and 5168 deletions
|
@ -1,44 +1,43 @@
|
|||
import { styles } from "@/styles/components/switch";
|
||||
import { Switch as NativeSwitch } from "@react-native-material/core";
|
||||
import { useState } from "react";
|
||||
import { Text } from "react-native";
|
||||
import { View } from "react-native";
|
||||
|
||||
interface Props {
|
||||
value: boolean;
|
||||
title?: string;
|
||||
onValueChange: () => void | Promise<void>;
|
||||
disabled?: boolean;
|
||||
value: boolean;
|
||||
title?: string;
|
||||
onValueChange: () => void | Promise<void>;
|
||||
disabled?: boolean;
|
||||
}
|
||||
|
||||
export default function Switch({
|
||||
value,
|
||||
title,
|
||||
onValueChange,
|
||||
disabled = false
|
||||
value,
|
||||
title,
|
||||
onValueChange,
|
||||
disabled = false,
|
||||
}: Props) {
|
||||
return (
|
||||
<View style={styles.switchContainer}>
|
||||
<NativeSwitch
|
||||
disabled={disabled}
|
||||
value={value}
|
||||
onValueChange={onValueChange}
|
||||
thumbColor={value ? "#2e3e6b" : "#222c47"}
|
||||
trackColor={{
|
||||
true: "#21273b",
|
||||
false: "#181c28",
|
||||
}}
|
||||
/>
|
||||
{title && (
|
||||
<Text
|
||||
style={{
|
||||
...styles.switchText,
|
||||
...(disabled && styles.switchTextDisabled)
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</Text>
|
||||
)}
|
||||
</View>
|
||||
)
|
||||
}
|
||||
return (
|
||||
<View style={styles.switchContainer}>
|
||||
<NativeSwitch
|
||||
disabled={disabled}
|
||||
value={value}
|
||||
onValueChange={onValueChange}
|
||||
thumbColor={value ? "#2e3e6b" : "#222c47"}
|
||||
trackColor={{
|
||||
true: "#21273b",
|
||||
false: "#181c28",
|
||||
}}
|
||||
/>
|
||||
{title && (
|
||||
<Text
|
||||
style={{
|
||||
...styles.switchText,
|
||||
...(disabled && styles.switchTextDisabled),
|
||||
}}
|
||||
>
|
||||
{title}
|
||||
</Text>
|
||||
)}
|
||||
</View>
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue