not floor rmv
This commit is contained in:
@@ -3,7 +3,6 @@ import Button from "../Button";
|
||||
import CrossIcon from "../icons/CrossIcon";
|
||||
import ResetIcon from "../icons/ResetIcon";
|
||||
import Checkbox from "../Checkbox";
|
||||
import Switch from "../Switch";
|
||||
import MultiRangeSlider from "../MultiRangeSlider";
|
||||
import {
|
||||
initialAparmentTypeCheckboxes,
|
||||
@@ -22,7 +21,6 @@ const MasterplanFilters = () => {
|
||||
setViewCheckboxes,
|
||||
multirangeSliders,
|
||||
setMultirangeSliders,
|
||||
switchers,
|
||||
setSwitchers,
|
||||
} = useMasterplanFilters();
|
||||
|
||||
@@ -67,17 +65,6 @@ const MasterplanFilters = () => {
|
||||
setMultirangeSliders(updatedSliders);
|
||||
};
|
||||
|
||||
const handleOnSwitcherClick = (switcherId: string) => {
|
||||
const updatedSwitchers = switchers.map((switcher) => {
|
||||
if (switcherId !== switcher.id) return switcher;
|
||||
const { isSwitched } = switcher;
|
||||
|
||||
return { ...switcher, isSwitched: !isSwitched };
|
||||
});
|
||||
|
||||
setSwitchers(updatedSwitchers);
|
||||
};
|
||||
|
||||
const handleOnResetClick = () => {
|
||||
setApartmentTypeCheckboxes(initialAparmentTypeCheckboxes);
|
||||
setViewCheckboxes(initialViewCheckboxes);
|
||||
@@ -123,15 +110,6 @@ const MasterplanFilters = () => {
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
|
||||
<div className="flex flex-col gap-2">
|
||||
{switchers.map((switcher) => (
|
||||
<div key={switcher.id} className="flex justify-between w-full">
|
||||
<p className="text-s text-[#73787C]">{switcher.title}</p>
|
||||
<Switch switcher={switcher} onClick={handleOnSwitcherClick} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col pt-6 w-full">
|
||||
<p className="text-[#0D1922] text-s pb-4">View</p>
|
||||
|
||||
@@ -5,13 +5,11 @@ import CrossIcon from "../../icons/CrossIcon";
|
||||
import { MobileModalWrapperContext } from "./MobileModalWrapper";
|
||||
import Checkbox from "../../Checkbox";
|
||||
import MultiRangeSlider from "../../MultiRangeSlider";
|
||||
import Switch from "../../Switch";
|
||||
import ResetIcon from "../../icons/ResetIcon";
|
||||
import { useSwipeable } from "react-swipeable";
|
||||
import {
|
||||
initialAparmentTypeCheckboxes,
|
||||
initialSliders,
|
||||
initialSwitchers,
|
||||
initialViewCheckboxes,
|
||||
} from "../../../consts/initialMasterplanFilters";
|
||||
import { ICheckbox } from "../../../types/checkbox";
|
||||
@@ -25,7 +23,6 @@ const MasterplanFiltersModal = () => {
|
||||
const [viewCheckboxes, setViewCheckboxes] = useState<ICheckbox[]>(
|
||||
initialViewCheckboxes
|
||||
);
|
||||
const [switchers, setSwitchers] = useState(initialSwitchers);
|
||||
const [multirangeSliders, setMultirangeSliders] = useState(initialSliders);
|
||||
const handlers = useSwipeable({
|
||||
onSwipedDown: () => handleOnCrossClick(),
|
||||
@@ -52,17 +49,6 @@ const MasterplanFiltersModal = () => {
|
||||
setApartmentTypeCheckboxes(updatedCheckboxes);
|
||||
};
|
||||
|
||||
const handleOnSwitcherClick = (switcherId: string) => {
|
||||
const updatedSwitchers = switchers.map((switcher) => {
|
||||
if (switcherId !== switcher.id) return switcher;
|
||||
const { isSwitched } = switcher;
|
||||
|
||||
return { ...switcher, isSwitched: !isSwitched };
|
||||
});
|
||||
|
||||
setSwitchers(updatedSwitchers);
|
||||
};
|
||||
|
||||
const handleOnSliderValueChange = (
|
||||
sliderId: string,
|
||||
e: [a: number, b: number]
|
||||
@@ -99,7 +85,6 @@ const MasterplanFiltersModal = () => {
|
||||
|
||||
const handleOnResetClick = () => {
|
||||
setViewCheckboxes(initialViewCheckboxes);
|
||||
setSwitchers(initialSwitchers);
|
||||
setMultirangeSliders(initialSliders);
|
||||
setApartmentTypeCheckboxes(initialAparmentTypeCheckboxes);
|
||||
};
|
||||
@@ -146,14 +131,6 @@ const MasterplanFiltersModal = () => {
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
<div className="flex flex-col gap-2 pt-6">
|
||||
{switchers.map((switcher) => (
|
||||
<div key={switcher.id} className="flex justify-between w-full">
|
||||
<p className="text-s text-[#73787C]">{switcher.title}</p>
|
||||
<Switch switcher={switcher} onClick={handleOnSwitcherClick} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div>
|
||||
<div className="flex flex-col w-full">
|
||||
<p className="text-[#0D1922] text-s pb-4">Views</p>
|
||||
|
||||
@@ -6,13 +6,11 @@ import { MobileModalWrapperContext } from "./MobileModalWrapper";
|
||||
import useSearchFilters from "../../../store/useSearchFilters";
|
||||
import Checkbox from "../../Checkbox";
|
||||
import MultiRangeSlider from "../../MultiRangeSlider";
|
||||
import Switch from "../../Switch";
|
||||
import ResetIcon from "../../icons/ResetIcon";
|
||||
import { useSwipeable } from "react-swipeable";
|
||||
import {
|
||||
initialAparmentTypeCheckboxes,
|
||||
initialSliders,
|
||||
initialSwitchers,
|
||||
initialViewCheckboxes,
|
||||
initialRoveHomeCheckboxes,
|
||||
} from "../../../consts/initialMasterplanFilters";
|
||||
@@ -26,8 +24,6 @@ const SearchFiltersModal = () => {
|
||||
const {
|
||||
multirangeSliders,
|
||||
setMultirangeSliders,
|
||||
switchers,
|
||||
setSwitchers,
|
||||
apartmentTypeCheckboxes,
|
||||
setApartmentTypeCheckboxes,
|
||||
roveHomeTypeCheckboxes,
|
||||
@@ -82,17 +78,6 @@ const SearchFiltersModal = () => {
|
||||
setRoveHomeTypeCheckboxes(updatedCheckboxes);
|
||||
};
|
||||
|
||||
const handleOnSwitcherClick = (switcherId: string) => {
|
||||
const updatedSwitchers = switchers.map((switcher) => {
|
||||
if (switcherId !== switcher.id) return switcher;
|
||||
const { isSwitched } = switcher;
|
||||
|
||||
return { ...switcher, isSwitched: !isSwitched };
|
||||
});
|
||||
|
||||
setSwitchers(updatedSwitchers);
|
||||
};
|
||||
|
||||
const handleOnSliderValueChange = (
|
||||
sliderId: string,
|
||||
e: [a: number, b: number]
|
||||
@@ -121,7 +106,7 @@ const SearchFiltersModal = () => {
|
||||
setViewCheckboxes(initialViewCheckboxes);
|
||||
setApartmentTypeCheckboxes(initialAparmentTypeCheckboxes);
|
||||
setRoveHomeTypeCheckboxes(initialRoveHomeCheckboxes);
|
||||
setSwitchers(initialSwitchers);
|
||||
// setSwitchers(initialSwitchers);
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -184,14 +169,14 @@ const SearchFiltersModal = () => {
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
<div className="flex flex-col gap-2 pt-6">
|
||||
{/* <div className="flex flex-col gap-2 pt-6">
|
||||
{switchers.map((switcher) => (
|
||||
<div key={switcher.id} className="flex justify-between w-full">
|
||||
<p className="text-s text-[#73787C]">{switcher.title}</p>
|
||||
<Switch switcher={switcher} onClick={handleOnSwitcherClick} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
</div> */}
|
||||
</div>
|
||||
<div className="grid grid-cols-2 gap-2">
|
||||
{viewCheckboxes.map((checkbox) => (
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import Button from "../Button";
|
||||
import ResetIcon from "../icons/ResetIcon";
|
||||
import Checkbox from "../Checkbox";
|
||||
import Switch from "../Switch";
|
||||
import MultiRangeSlider from "../MultiRangeSlider";
|
||||
import useSearchFilters from "../../store/useSearchFilters";
|
||||
import {
|
||||
initialViewCheckboxes,
|
||||
initialAparmentTypeCheckboxes,
|
||||
initialSliders,
|
||||
initialSwitchers,
|
||||
initialRoveHomeCheckboxes,
|
||||
pageInitial,
|
||||
perPageInitial,
|
||||
@@ -18,8 +16,6 @@ const SidebarFilters = () => {
|
||||
const {
|
||||
multirangeSliders,
|
||||
setMultirangeSliders,
|
||||
switchers,
|
||||
setSwitchers,
|
||||
apartmentTypeCheckboxes,
|
||||
setApartmentTypeCheckboxes,
|
||||
roveHomeTypeCheckboxes,
|
||||
@@ -65,17 +61,6 @@ const SidebarFilters = () => {
|
||||
setMultirangeSliders(updatedSliders);
|
||||
};
|
||||
|
||||
const handleOnSwitcherClick = (switcherId: string) => {
|
||||
const updatedSwitchers = switchers.map((switcher) => {
|
||||
if (switcherId !== switcher.id) return switcher;
|
||||
const { isSwitched } = switcher;
|
||||
|
||||
return { ...switcher, isSwitched: !isSwitched };
|
||||
});
|
||||
|
||||
setSwitchers(updatedSwitchers);
|
||||
};
|
||||
|
||||
const handleOnViewCheckboxClick = (checkboxId: string) => {
|
||||
const updatedCheckboxes = viewCheckboxes.map((cbox) => {
|
||||
if (checkboxId !== cbox.id) return cbox;
|
||||
@@ -92,7 +77,6 @@ const SidebarFilters = () => {
|
||||
setApartmentTypeCheckboxes(initialAparmentTypeCheckboxes);
|
||||
setRoveHomeTypeCheckboxes(initialRoveHomeCheckboxes);
|
||||
setMultirangeSliders(initialSliders);
|
||||
setSwitchers(initialSwitchers);
|
||||
setPage(pageInitial);
|
||||
setPerPage(perPageInitial);
|
||||
};
|
||||
@@ -147,15 +131,6 @@ const SidebarFilters = () => {
|
||||
/>
|
||||
</div>
|
||||
))}
|
||||
|
||||
<div className="flex flex-col gap-2">
|
||||
{switchers.map((switcher) => (
|
||||
<div key={switcher.id} className="flex justify-between w-full">
|
||||
<p className="text-s text-[#73787C]">{switcher.title}</p>
|
||||
<Switch switcher={switcher} onClick={handleOnSwitcherClick} />
|
||||
</div>
|
||||
))}
|
||||
</div>
|
||||
<div className="flex flex-col w-full">
|
||||
<p className="text-[#0D1922] text-s pb-4">Views</p>
|
||||
<div className="flex flex-col gap-2">
|
||||
|
||||
Reference in New Issue
Block a user