добавлены новые хуки и обработчики в Header, улучшен ModalContainer, добавлены сортировки в FavoritesPage и исправлены стили в различных компонентах.
This commit is contained in:
@@ -56,6 +56,18 @@ function FavoritesPage() {
|
||||
.filter(
|
||||
(unit) => !selectedProject || unit.project === selectedProject
|
||||
)
|
||||
.sort((a, b) => {
|
||||
if (sort === "Sort by ascending price") {
|
||||
return a.salesPrice - b.salesPrice;
|
||||
} else if (sort === "Sort by descending price") {
|
||||
return b.salesPrice - a.salesPrice;
|
||||
} else if (sort === "Sort by ascending area") {
|
||||
return a.squareFt - b.squareFt;
|
||||
} else if (sort === "Sort by descending area") {
|
||||
return b.squareFt - a.squareFt;
|
||||
}
|
||||
return 0;
|
||||
})
|
||||
.map((unit) => (
|
||||
<UnitCard key={unit.id} unit={unit} />
|
||||
))}
|
||||
|
||||
@@ -68,15 +68,21 @@ function SearchPage() {
|
||||
view ? `&view=${view}` : ""
|
||||
}${
|
||||
debouncedCost.length > 0
|
||||
? `&cost=${debouncedCost.map(Math.round).join()}`
|
||||
? `&cost=${Math.floor(debouncedCost[0])},${Math.ceil(
|
||||
debouncedCost[1]
|
||||
)}`
|
||||
: ""
|
||||
}${
|
||||
debouncedFloor.length > 0
|
||||
? `&floor=${debouncedFloor.map(Math.round).join()}`
|
||||
? `&floor=${Math.floor(debouncedFloor[0])},${Math.ceil(
|
||||
debouncedFloor[1]
|
||||
)}`
|
||||
: ""
|
||||
}${
|
||||
debouncedArea.length > 0
|
||||
? `&area=${debouncedArea.map(Math.round).join()}`
|
||||
? `&area=${Math.floor(debouncedArea[0])},${Math.ceil(
|
||||
debouncedArea[1]
|
||||
)}`
|
||||
: ""
|
||||
}${sort ? `&order=${SORT_OPTIONS[sort].split(" ").join()}` : ""}`
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user