Changes in Image-Gallery Page then DateRange cross button will work correctly.
This commit is contained in:
parent
d4be35b44d
commit
eaccf0fca2
@ -99,15 +99,23 @@ const ImageGalleryPage = () => {
|
|||||||
const handleRemoveFilter = (filterKey, valueId) => {
|
const handleRemoveFilter = (filterKey, valueId) => {
|
||||||
setAppliedFilters((prev) => {
|
setAppliedFilters((prev) => {
|
||||||
const updated = { ...prev };
|
const updated = { ...prev };
|
||||||
|
|
||||||
if (Array.isArray(updated[filterKey])) {
|
if (Array.isArray(updated[filterKey])) {
|
||||||
updated[filterKey] = updated[filterKey].filter((id) => id !== valueId);
|
updated[filterKey] = updated[filterKey].filter((id) => id !== valueId);
|
||||||
} else if (filterKey === "startDate" || filterKey === "endDate") {
|
}
|
||||||
|
else if (filterKey === "startDate" || filterKey === "endDate") {
|
||||||
updated[filterKey] = null;
|
updated[filterKey] = null;
|
||||||
}
|
}
|
||||||
|
else if (filterKey === "dateRange") {
|
||||||
|
updated.startDate = null;
|
||||||
|
updated.endDate = null;
|
||||||
|
}
|
||||||
|
|
||||||
return updated;
|
return updated;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// --- Chips ---
|
// --- Chips ---
|
||||||
const appliedFiltersChips = useMemo(() => {
|
const appliedFiltersChips = useMemo(() => {
|
||||||
const chips = [];
|
const chips = [];
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user