chore: add color for category
This commit is contained in:
@@ -116,6 +116,7 @@ export const logoutUser = async (): Promise<void> => {
|
||||
export interface Category {
|
||||
id: number;
|
||||
name: string;
|
||||
color: string;
|
||||
created_at: string;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,15 +8,17 @@ interface CategoryPillProps {
|
||||
label: string;
|
||||
active: boolean;
|
||||
onPress: () => void;
|
||||
color?: string;
|
||||
}
|
||||
|
||||
export default function CategoryPill({
|
||||
label,
|
||||
active,
|
||||
onPress,
|
||||
color,
|
||||
}: CategoryPillProps) {
|
||||
const { colors } = useTheme();
|
||||
const catColor = getCategoryColor(label, colors);
|
||||
const catColor = color || getCategoryColor(label, colors);
|
||||
return (
|
||||
<TouchableOpacity
|
||||
onPress={onPress}
|
||||
|
||||
@@ -205,6 +205,7 @@ export default function ProductsScreen() {
|
||||
label={cat.name}
|
||||
active={selectedCategory === cat.name}
|
||||
onPress={() => setSelectedCategory(cat.name)}
|
||||
color={cat.color}
|
||||
/>
|
||||
))}
|
||||
</ScrollView>
|
||||
|
||||
Reference in New Issue
Block a user