chore: add color for category

This commit is contained in:
2026-03-07 15:48:27 +01:00
parent 8edc14ca55
commit 125d066dcb
5 changed files with 133 additions and 13 deletions
+1
View File
@@ -116,6 +116,7 @@ export const logoutUser = async (): Promise<void> => {
export interface Category {
id: number;
name: string;
color: string;
created_at: string;
}
+3 -1
View File
@@ -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>