chore: fix color
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import React, { useState, useEffect, useCallback, useMemo } from "react";
|
||||
import { useFocusEffect } from "@react-navigation/native";
|
||||
import {
|
||||
View,
|
||||
Text,
|
||||
@@ -128,9 +129,11 @@ export default function ProductsScreen() {
|
||||
setLoading(false);
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
useFocusEffect(
|
||||
useCallback(() => {
|
||||
loadData();
|
||||
}, [loadData]);
|
||||
}, [loadData]),
|
||||
);
|
||||
const onRefresh = async () => {
|
||||
setRefreshing(true);
|
||||
await loadData();
|
||||
@@ -756,7 +759,7 @@ export default function ProductsScreen() {
|
||||
<Text style={styles.name}>{item.name}</Text>
|
||||
<Badge
|
||||
label={item.category}
|
||||
color={getCategoryColor(item.category, colors)}
|
||||
color={categories.find(c => c.name === item.category)?.color || getCategoryColor(item.category, colors)}
|
||||
/>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user