You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Mobile/components/CheckboxComponent.tsx

21 lines
732 B

import React from "react";
import { View, Text, TouchableOpacity } from "react-native";
interface CheckBoxProps {
label: string;
value: boolean;
onChange: () => void;
}
const CheckBox: React.FC<CheckBoxProps> = ({ label, value, onChange }) => {
return (
<TouchableOpacity onPress={onChange} className={`p-5 m-1 rounded-2xl ${value ? 'bg-orange-600' : 'bg-gray-300'} flex-row items-center`}>
<View className={`h-5 w-5 rounded border ${value ? 'border-white' : 'border-black'} items-center justify-center mr-2.5`}>
{value && <View className="h-3 w-3 bg-white" />}
</View>
<Text>{label}</Text>
</TouchableOpacity>
);
};
export default CheckBox;