Initial Commit

This commit is contained in:
Eric Gullickson
2025-12-17 15:43:32 -06:00
parent cd0cfa8913
commit b611b56336
16 changed files with 83 additions and 202 deletions

View File

@@ -146,6 +146,20 @@ export const StationsPage: React.FC = () => {
};
}, [savedStations]);
// Compute which stations to display on map based on active tab
const mapStations = useMemo(() => {
if (tabValue === 1) {
// Saved tab: show saved stations with valid coordinates
return savedStations.filter(
(station) =>
station.latitude !== undefined &&
station.longitude !== undefined
) as Station[];
}
// Results tab: show search results
return searchResults;
}, [tabValue, savedStations, searchResults]);
// Handle search
const handleSearch = (request: StationSearchRequest) => {
setCurrentLocation({ latitude: request.latitude, longitude: request.longitude });
@@ -246,7 +260,7 @@ export const StationsPage: React.FC = () => {
<GoogleMapsErrorBoundary>
<StationMap
key="mobile-station-map"
stations={searchResults}
stations={mapStations}
savedPlaceIds={savedPlaceIds}
currentLocation={currentLocation}
center={mapCenter || undefined}
@@ -315,7 +329,7 @@ export const StationsPage: React.FC = () => {
<GoogleMapsErrorBoundary>
<StationMap
key="desktop-station-map"
stations={searchResults}
stations={mapStations}
savedPlaceIds={savedPlaceIds}
currentLocation={currentLocation}
center={mapCenter || undefined}

View File

@@ -39,10 +39,18 @@ export const BottomNavigation: React.FC<BottomNavigationProps> = ({
}}
>
{items.map(({ key, label, icon }) => (
<BottomNavigationAction
<BottomNavigationAction
key={key}
label={label}
icon={icon}
label={label}
icon={icon}
sx={{
'& .MuiBottomNavigationAction-label': {
fontSize: '0.75rem',
'&.Mui-selected': {
fontSize: '0.75rem'
}
}
}}
/>
))}
</MuiBottomNavigation>