Skip to content

Commit

Permalink
filter styling
Browse files Browse the repository at this point in the history
  • Loading branch information
katyhonguyen committed Dec 23, 2024
1 parent f9d2b4f commit c33d7b4
Show file tree
Hide file tree
Showing 10 changed files with 370 additions and 138 deletions.
74 changes: 74 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@
"react-native-element-dropdown": "^2.12.2",
"react-native-elements": "^3.4.3",
"react-native-gesture-handler": "~2.20.2",
"react-native-paper": "^5.12.5",
"react-native-reanimated": "~3.16.1",
"react-native-safe-area-context": "^4.12.0",
"react-native-screens": "~4.1.0",
Expand Down
35 changes: 35 additions & 0 deletions src/components/Checkbox/Checkbox.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import React, { useState } from 'react';
import { Text, View } from 'react-native';
import { Checkbox } from 'react-native-paper';
import colors from '@/styles/colors';
import { styles } from './styles';

interface CheckboxComponentProps {
checked: boolean;
onToggle: () => void;
label: string;
}

const CheckboxComponent: React.FC<CheckboxComponentProps> = ({
checked,
label,
}) => {
const [isChecked, setChecked] = useState(checked);
return (
<View style={styles.checkboxContainer}>
<View style={styles.checkboxWrapper}>
<Checkbox
status={isChecked ? 'checked' : 'unchecked'}
onPress={() => {
setChecked(!isChecked);
}}
color={colors.primary}
uncheckedColor={colors.gray5}
/>
</View>
<Text style={styles.checkboxLabel}>{label}</Text>
</View>
);
};

export default CheckboxComponent;
24 changes: 24 additions & 0 deletions src/components/Checkbox/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { StyleSheet } from 'react-native';
import colors from '@/styles/colors';
import typography from '@/styles/typography';

export const styles = StyleSheet.create({
checkboxContainer: {
flexDirection: 'row',
alignItems: 'center',
},
checkboxWrapper: {
width: 20,
height: 20,
backgroundColor: colors.gray5,
borderRadius: 5,
justifyContent: 'center',
alignItems: 'center',
marginRight: 10,
},
checkboxLabel: {
marginLeft: 10,
...typography.normalRegular,
color: colors.gray3,
},
});
Loading

0 comments on commit c33d7b4

Please sign in to comment.