Compare commits

..

2 Commits

Author SHA1 Message Date
2ffe3a0197 Change price filter max to mean no limit
Some checks failed
Deploy Apartment Dashboard / deploy (push) Has been cancelled
When the slider is at max (10000), no price filtering is applied.
Moving below 10000 starts filtering. Display shows "No limit" at max.
2026-01-21 13:13:42 -07:00
4e8d64ddc8 Frontend improvements (#2)
Some checks failed
Deploy Apartment Dashboard / deploy (push) Failing after 1s
Co-authored-by: Stephen Minakian <stephenminakian@gmail.com>
Co-committed-by: Stephen Minakian <stephenminakian@gmail.com>
2026-01-21 12:04:13 -07:00

View File

@ -384,7 +384,8 @@ const ApartmentDashboard = () => {
// Filter function for units
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);
return matchesPrice && matchesBedroom;
}).sort((a, b) => {
@ -672,16 +673,16 @@ const ApartmentDashboard = () => {
</div>
<div className="flex items-center space-x-2">
<label className="text-sm font-medium">Max Price:</label>
<input
type="range"
min="0"
max="10000"
<input
type="range"
min="0"
max="10000"
step="100"
value={priceFilter.max}
onChange={(e) => setPriceFilter({...priceFilter, max: parseInt(e.target.value)})}
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>
<select
value={bedroomFilter}