.
This commit is contained in:
@@ -12,7 +12,7 @@ export default function MainSection({
|
||||
() => ({ All: "All Categories", ...categories }),
|
||||
[categories]
|
||||
);
|
||||
const [tab, setTab] = useState(marketCategories.All);
|
||||
const [tab, setTab] = useState(Object.keys(marketCategories)[0]);
|
||||
|
||||
// Convert to array in order to map
|
||||
const mappedArray = Object.entries(marketCategories).map(([key, value]) => {
|
||||
@@ -24,7 +24,7 @@ export default function MainSection({
|
||||
setTab(value);
|
||||
};
|
||||
useEffect(() => {
|
||||
if (tab === marketCategories.All) {
|
||||
if (tab === "All") {
|
||||
setProducts(marketPlaceProduct);
|
||||
} else {
|
||||
const filteredProducts = marketPlaceProduct.filter((product) =>
|
||||
|
||||
Reference in New Issue
Block a user