side bar left bug fix
This commit is contained in:
@@ -120,7 +120,12 @@ const Assets: React.FC = () => {
|
|||||||
echo.error("failed to fetch assets");
|
echo.error("failed to fetch assets");
|
||||||
setisLoading(false);
|
setisLoading(false);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (asset === "Decals") {
|
||||||
|
fetchCategoryDecals("Safety");
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const fetchCategoryDecals = async (asset: any) => {
|
const fetchCategoryDecals = async (asset: any) => {
|
||||||
setisLoading(true);
|
setisLoading(true);
|
||||||
// setSelectedCategory(asset);
|
// setSelectedCategory(asset);
|
||||||
@@ -226,9 +231,8 @@ const Assets: React.FC = () => {
|
|||||||
{activeSubcategories.map((cat, index) => (
|
{activeSubcategories.map((cat, index) => (
|
||||||
<div
|
<div
|
||||||
key={index}
|
key={index}
|
||||||
className={`catogory-asset-filter-wrapper ${
|
className={`catogory-asset-filter-wrapper ${selectedSubCategory === cat.name ? "active" : ""
|
||||||
selectedSubCategory === cat.name ? "active" : ""
|
}`}
|
||||||
}`}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
fetchCategoryDecals(cat.name);
|
fetchCategoryDecals(cat.name);
|
||||||
setSelectedSubCategory(cat.name);
|
setSelectedSubCategory(cat.name);
|
||||||
|
|||||||
@@ -664,6 +664,6 @@ interface DecalStore {
|
|||||||
|
|
||||||
// Create the Zustand store with types
|
// Create the Zustand store with types
|
||||||
export const useDecalStore = create<DecalStore>((set) => ({
|
export const useDecalStore = create<DecalStore>((set) => ({
|
||||||
selectedSubCategory: null,
|
selectedSubCategory: 'Safety',
|
||||||
setSelectedSubCategory: (subCategory: string | null) => set({ selectedSubCategory: subCategory }),
|
setSelectedSubCategory: (subCategory: string | null) => set({ selectedSubCategory: subCategory }),
|
||||||
}));
|
}));
|
||||||
|
|||||||
Reference in New Issue
Block a user