Frontend improvements #2

Merged
stephen merged 6 commits from frontend-improvements into main 2026-01-21 12:04:13 -07:00
Showing only changes of commit e79f28f52b - Show all commits

View File

@ -397,6 +397,7 @@ const ApartmentDashboard = () => {
case 'price': return dir * ((a.currentPrice || 0) - (b.currentPrice || 0));
case 'pricePerSqft': return dir * (((a.currentPrice || 0) / (a.area || 1)) - ((b.currentPrice || 0) / (b.area || 1)));
case 'daysAvailable': return dir * ((a.daysAvailable || 0) - (b.daysAvailable || 0));
case 'soonest': return dir * (a.soonest || '').localeCompare(b.soonest || '');
default: return 0;
}
});
@ -858,6 +859,15 @@ const ApartmentDashboard = () => {
{sortBy === 'daysAvailable' && (sortDirection === 'asc' ? <ArrowUp className="w-4 h-4 ml-1" /> : <ArrowDown className="w-4 h-4 ml-1" />)}
</span>
</th>
<th
className="text-center py-3 px-4 font-semibold text-gray-700 cursor-pointer hover:bg-gray-100 select-none"
onClick={() => handleSort('soonest')}
>
<span className="flex items-center justify-center">
Soonest
{sortBy === 'soonest' && (sortDirection === 'asc' ? <ArrowUp className="w-4 h-4 ml-1" /> : <ArrowDown className="w-4 h-4 ml-1" />)}
</span>
</th>
<th className="text-center py-3 px-4 font-semibold text-gray-700">Actions</th>
</tr>
</thead>
@ -874,6 +884,7 @@ const ApartmentDashboard = () => {
<td className="py-3 px-4 text-right font-bold text-green-600">{formatPrice(unit.currentPrice)}</td>
<td className="py-3 px-4 text-right text-gray-500">${((unit.currentPrice || 0) / (unit.area || 1)).toFixed(2)}</td>
<td className="py-3 px-4 text-center">{unit.daysAvailable || 0}</td>
<td className="py-3 px-4 text-center">{unit.soonest ? formatDate(unit.soonest) : '-'}</td>
<td className="py-3 px-4">
<div className="flex justify-center space-x-2">
<button