1 |
af8eb9a6
|
Schwobik
|
import { Switch, View, Text } from "native-base"
|
2 |
|
|
|
3 |
|
|
interface SwitchWithLabelProps {
|
4 |
|
|
label: string,
|
5 |
|
|
value: boolean,
|
6 |
|
|
onValueChange: (value: boolean) => void,
|
7 |
|
|
}
|
8 |
|
|
|
9 |
|
|
const SwitchWithLabel = (props: SwitchWithLabelProps) => {
|
10 |
|
|
|
11 |
|
|
return (
|
12 |
|
|
<View
|
13 |
|
|
flexDirection={ "row" }
|
14 |
|
|
alignItems={ "center" }
|
15 |
|
|
justifyContent={ "space-between" }
|
16 |
|
|
>
|
17 |
|
|
<Text>{ props.label }</Text>
|
18 |
|
|
<Switch value={ props.value } onValueChange={ props.onValueChange } size={"sm"} key={props.label}/>
|
19 |
|
|
</View>
|
20 |
|
|
)
|
21 |
|
|
}
|
22 |
|
|
|
23 |
|
|
export default SwitchWithLabel
|