| 1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import React from 'react';
- import { StyleSheet } from 'react-native';
- import CheckBoxBase from '@react-native-community/checkbox';
- const CheckBox = ({
- value=false,
- disabled=false,
- onValueChange,
- iosSize=24
- }) => {
- if (isIOS) {
- return (
- <MaterialIcons
- name={value ? "check-box" : "check-box-outline-blank"}
- size={iosSize}
- color={value ? colorAccent : '#777'}
- style={styles.checkBoxView}
- onPress={() => {
- if (onValueChange)
- onValueChange(!value)
- }}
- />
- );
- } else {
- return (
- <CheckBoxBase
- value={value}
- disabled={disabled}
- onValueChange={onValueChange}
- />
- )
- }
- }
- const styles = StyleSheet.create({
- checkBoxView: {
- padding: 4
- }
- })
- export default CheckBox;
|