Compare commits
2 Commits
frontend-i
...
2ffe3a0197
| Author | SHA1 | Date | |
|---|---|---|---|
| 2ffe3a0197 | |||
| 4e8d64ddc8 |
13
src/App.jsx
13
src/App.jsx
@ -384,7 +384,8 @@ const ApartmentDashboard = () => {
|
|||||||
|
|
||||||
// Filter function for units
|
// Filter function for units
|
||||||
const filteredUnits = availableUnits.filter(unit => {
|
const filteredUnits = availableUnits.filter(unit => {
|
||||||
const matchesPrice = (unit.currentPrice || 0) >= priceFilter.min && (unit.currentPrice || 0) <= priceFilter.max;
|
const price = unit.currentPrice || 0;
|
||||||
|
const matchesPrice = price >= priceFilter.min && (priceFilter.max === 10000 || price <= priceFilter.max);
|
||||||
const matchesBedroom = bedroomFilter === 'all' || (unit.bedCount != null && unit.bedCount.toString() === bedroomFilter);
|
const matchesBedroom = bedroomFilter === 'all' || (unit.bedCount != null && unit.bedCount.toString() === bedroomFilter);
|
||||||
return matchesPrice && matchesBedroom;
|
return matchesPrice && matchesBedroom;
|
||||||
}).sort((a, b) => {
|
}).sort((a, b) => {
|
||||||
@ -672,16 +673,16 @@ const ApartmentDashboard = () => {
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex items-center space-x-2">
|
<div className="flex items-center space-x-2">
|
||||||
<label className="text-sm font-medium">Max Price:</label>
|
<label className="text-sm font-medium">Max Price:</label>
|
||||||
<input
|
<input
|
||||||
type="range"
|
type="range"
|
||||||
min="0"
|
min="0"
|
||||||
max="10000"
|
max="10000"
|
||||||
step="100"
|
step="100"
|
||||||
value={priceFilter.max}
|
value={priceFilter.max}
|
||||||
onChange={(e) => setPriceFilter({...priceFilter, max: parseInt(e.target.value)})}
|
onChange={(e) => setPriceFilter({...priceFilter, max: parseInt(e.target.value)})}
|
||||||
className="w-32"
|
className="w-32"
|
||||||
/>
|
/>
|
||||||
<span className="text-sm">{formatPrice(priceFilter.max)}</span>
|
<span className="text-sm">{priceFilter.max === 10000 ? 'No limit' : formatPrice(priceFilter.max)}</span>
|
||||||
</div>
|
</div>
|
||||||
<select
|
<select
|
||||||
value={bedroomFilter}
|
value={bedroomFilter}
|
||||||
|
|||||||
Reference in New Issue
Block a user