feat(ui): redesign landing page search and empty states
All checks were successful
Build and Push Docker Images / Build Backend (FastAPI) (push) Successful in 42s
Build and Push Docker Images / Build Frontend (Next.js) (push) Successful in 1m12s
Build and Push Docker Images / Trigger Portainer Update (push) Successful in 1s

- Hide empty state placeholder on initial load

- Add prominent hero mode to FilterBar when no search is active

- Fix SchoolCard test TypeScript and assertion errors
This commit is contained in:
Tudor
2026-03-05 13:00:34 +00:00
parent 2b808959c5
commit d4abb56c22
4 changed files with 38 additions and 24 deletions

View File

@@ -29,6 +29,7 @@ export function HomeView({ initialSchools, filters }: HomeViewProps) {
const hasSearch = searchParams.get('search') || searchParams.get('postcode');
const isLocationSearch = !!searchParams.get('postcode');
const isSearchActive = !!(hasSearch || searchParams.get('local_authority') || searchParams.get('school_type'));
// Close bottom sheet if we change views or search
useEffect(() => {
@@ -45,6 +46,7 @@ export function HomeView({ initialSchools, filters }: HomeViewProps) {
<FilterBar
filters={filters}
isHero={!isSearchActive}
/>
{/* Location Info Banner with View Toggle */}
@@ -107,26 +109,18 @@ export function HomeView({ initialSchools, filters }: HomeViewProps) {
</div>
)}
{initialSchools.schools.length === 0 ? (
{initialSchools.schools.length === 0 && isSearchActive ? (
<EmptyState
title={hasSearch ? "No schools found" : "Search for Schools"}
message={
hasSearch
? "Try adjusting your search criteria or filters to find schools."
: "Use the search above to find schools by name or search by location to discover schools near a postcode."
}
action={
hasSearch
? {
label: 'Clear all filters and show featured schools',
onClick: () => {
window.location.href = '/';
},
}
: undefined
}
title="No schools found"
message="Try adjusting your search criteria or filters to find schools."
action={{
label: 'Clear all filters',
onClick: () => {
window.location.href = '/';
},
}}
/>
) : resultsView === 'map' && isLocationSearch ? (
) : initialSchools.schools.length > 0 && resultsView === 'map' && isLocationSearch ? (
/* Map View Layout */
<div className={styles.mapViewContainer}>
<div className={styles.mapContainer}>