Projekt

Obecné

Profil

Stáhnout (628 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1 e49b1f44 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 5f3c7202 Michal Schwob
            key={props.label}
17 e49b1f44 Schwobik
        >
18
            <Text>{ props.label }</Text>
19 5f3c7202 Michal Schwob
            <Switch isChecked={ props.value } onValueChange={ props.onValueChange } size={"sm"} key={props.label}/>
20 e49b1f44 Schwobik
        </View>
21
    )
22
}
23
24
export default SwitchWithLabel