diff --git a/src/main.tsx b/src/main.tsx
index bd39249..08e41c1 100644
--- a/src/main.tsx
+++ b/src/main.tsx
@@ -9,6 +9,7 @@ import ComplexWing from "./pages/ComplexWing";
import Search from "./pages/Search";
import SearchParticularApartments from "./pages/SearchParticularApartments";
import SearchApartment from "./pages/SearchApartment";
+import Favorites from "./pages/Favorites";
const router = createBrowserRouter([
{
@@ -47,6 +48,10 @@ const router = createBrowserRouter([
path: "/search/:apartmentType/:apartmentId",
element: ,
},
+ {
+ path: "/favorites",
+ element: ,
+ },
],
},
]);
diff --git a/src/pages/Favorites.tsx b/src/pages/Favorites.tsx
new file mode 100644
index 0000000..9155a44
--- /dev/null
+++ b/src/pages/Favorites.tsx
@@ -0,0 +1,204 @@
+import { useState, useEffect } from "react";
+import { sortCardBy } from "../calc/sortCard";
+import Button from "../components/Button";
+import Footer from "../components/Footer";
+import FiltersIcon from "../components/icons/FiltersIcon";
+import TrashIcon from "../components/icons/TrashIcon";
+import SortButton from "../components/searchPage/SortButton";
+import { initialSortList } from "../consts/initialSearchPage";
+import { ILayoutCard } from "../types/layoutCard";
+import FavoriteAppartmentCard from "../components/favoritesPage/FavoriteApartmentCard";
+
+const favoriteCards: ILayoutCard[] = [
+ {
+ id: "1",
+ roveHome: "Marasi Drive",
+ apartmentType: "Studio Flex",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 10488888,
+ square: 619,
+ },
+ {
+ id: "2",
+ roveHome: "Marasi Drive",
+ apartmentType: "1 Bedroom",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 1668888,
+ square: 619,
+ },
+ {
+ id: "3",
+ roveHome: "Marasi Drive",
+ apartmentType: "1 Bedroom",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 1668888,
+ square: 609,
+ },
+ {
+ id: "4",
+ roveHome: "Marasi Drive",
+ apartmentType: "1 Bedroom",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 1138888,
+ square: 609,
+ },
+ {
+ id: "5",
+ roveHome: "Marasi Drive",
+ apartmentType: "Studio Flex",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 10488888,
+ square: 609,
+ },
+ {
+ id: "6",
+ roveHome: "Marasi Drive",
+ apartmentType: "1 Bedroom",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 1668888,
+ square: 609,
+ },
+ {
+ id: "7",
+ roveHome: "Marasi Drive",
+ apartmentType: "1 Bedroom",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 1668888,
+ square: 609,
+ },
+ {
+ id: "8",
+ roveHome: "Marasi Drive",
+ apartmentType: "1 Bedroom",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 1138888,
+ square: 609,
+ },
+ {
+ id: "9",
+ roveHome: "Marasi Drive",
+ apartmentType: "Studio Flex",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 10488888,
+ square: 609,
+ },
+ {
+ id: "10",
+ roveHome: "Marasi Drive",
+ apartmentType: "1 Bedroom",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 1668888,
+ square: 609,
+ },
+ {
+ id: "11",
+ roveHome: "Marasi Drive",
+ apartmentType: "1 Bedroom",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 1668888,
+ square: 609,
+ },
+ {
+ id: "12",
+ roveHome: "Marasi Drive",
+ apartmentType: "1 Bedroom",
+ wing: "East Wing",
+ floorStart: 11,
+ floorEnd: 35,
+ units: 234,
+ cost: 1138888,
+ square: 609,
+ },
+];
+
+const Favorites = () => {
+ const [sortList, setSortList] = useState(initialSortList);
+ const [cards, setCards] = useState(favoriteCards);
+
+ const handleOnSortClick = (sortId: string) => {
+ const updatedSortList = sortList.map((sort) => {
+ const isSelected = sort.id === sortId;
+ return { ...sort, isSelected: isSelected };
+ });
+ setSortList(updatedSortList);
+ };
+
+ useEffect(() => {
+ const sortedCards = sortCardBy(sortList, favoriteCards);
+
+ setCards(sortedCards);
+ }, [sortList]);
+
+ return (
+
+
+
+
+
+
+
+ }
+ className="text-[#73787C]"
+ text={"Compare"}
+ />
+ }
+ className="text-[#73787C]"
+ text="Remove all"
+ />
+
+
+
+
+
+
+ {cards.map((card) => (
+
+ ))}
+
+
+
+
+ );
+};
+
+export default Favorites;
diff --git a/src/pages/SearchApartment.tsx b/src/pages/SearchApartment.tsx
index 61d95c3..a40d12f 100644
--- a/src/pages/SearchApartment.tsx
+++ b/src/pages/SearchApartment.tsx
@@ -1,51 +1,19 @@
-import { useState } from "react";
-import Button from "../components/Button";
import Footer from "../components/Footer";
-import SwitchToggle from "../components/SwitchToggle";
-import HeartIcon from "../components/icons/Heart";
-import LeftArrowSliderIcon from "../components/icons/LeftArrowSliderIcon";
-import { ISwitchLabel } from "../types/switchLabel";
-
-const apartmentLayouts: ISwitchLabel[] = [
- { id: "1", label: "Layout" },
- { id: "2", label: "On the floor" },
-];
+import ButtonPanel from "../components/searchApartment/ButtonPanel";
+import ApartmentLayout from "../components/searchApartment/ApartmentLayout";
+import ApartmentSidebar from "../components/searchApartment/ApartmentSidebar";
const SearchApartment = () => {
- const [currentLabel, setCurrentLabel] = useState(apartmentLayouts[0]);
- const handleOnSwitchClick = (label: ISwitchLabel) => {
- setCurrentLabel(label);
- };
return (
-
-
-
-
-
} buttonType="cta" />
-
-
- № 213
-
-
- 1 bedroom apartment
-
-
-
-
} />
-
-
-
-
-

-
-
+