Initial Commit
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user