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