index.tsx 738 B

1234567891011121314151617181920212223242526272829
  1. import React, { FC } from 'react';
  2. import Checkbox from 'expo-checkbox';
  3. import { Text, View } from 'react-native';
  4. import { Colors } from '../../theme';
  5. import { styles } from './styles';
  6. type Props = {
  7. onChange?: (value: boolean) => void;
  8. value?: boolean;
  9. label?: string;
  10. color?: string;
  11. disabled?: boolean;
  12. };
  13. export const CheckBox: FC<Props> = ({ value, onChange, label, color, disabled }) => {
  14. return (
  15. <View style={styles.wrapper}>
  16. <Checkbox
  17. style={{ backgroundColor: Colors.WHITE }}
  18. color={color || Colors.ORANGE}
  19. value={value}
  20. onValueChange={onChange}
  21. disabled={disabled}
  22. />
  23. {label ? <Text style={styles.text}>{label}</Text> : null}
  24. </View>
  25. );
  26. };