aboutsummaryrefslogtreecommitdiff
path: root/src/frontend/app/components/NavBar.tsx
diff options
context:
space:
mode:
authorCopilot <198982749+Copilot@users.noreply.github.com>2025-06-26 23:44:25 +0200
committerGitHub <noreply@github.com>2025-06-26 23:44:25 +0200
commit7b8594debceb93a1fa400d48fe1dcff943bd5af6 (patch)
tree73e68c7238a91d8931d669364d395ce2994164f4 /src/frontend/app/components/NavBar.tsx
parent3dac17a9fb54c977c97280ed4c482e9d4266b7de (diff)
Implement stop sheet modal for map stop interactions (#27)
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: arielcostas <94913521+arielcostas@users.noreply.github.com> Co-authored-by: Ariel Costas Guerrero <ariel@costas.dev>
Diffstat (limited to 'src/frontend/app/components/NavBar.tsx')
-rw-r--r--src/frontend/app/components/NavBar.tsx30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/frontend/app/components/NavBar.tsx b/src/frontend/app/components/NavBar.tsx
index eba7196..6a06e63 100644
--- a/src/frontend/app/components/NavBar.tsx
+++ b/src/frontend/app/components/NavBar.tsx
@@ -9,14 +9,14 @@ function isWithinVigo(lngLat: LngLatLike): boolean {
let lng: number, lat: number;
if (Array.isArray(lngLat)) {
[lng, lat] = lngLat;
- } else if ('lng' in lngLat && 'lat' in lngLat) {
+ } else if ("lng" in lngLat && "lat" in lngLat) {
lng = lngLat.lng;
lat = lngLat.lat;
} else {
return false;
}
// Rough bounding box for Vigo
- return lat >= 42.18 && lat <= 42.30 && lng >= -8.78 && lng <= -8.65;
+ return lat >= 42.18 && lat <= 42.3 && lng >= -8.78 && lng <= -8.65;
}
export default function NavBar() {
@@ -25,20 +25,20 @@ export default function NavBar() {
const navItems = [
{
- name: t('navbar.stops', 'Paradas'),
+ name: t("navbar.stops", "Paradas"),
icon: MapPin,
- path: '/stops'
+ path: "/stops",
},
{
- name: t('navbar.map', 'Mapa'),
+ name: t("navbar.map", "Mapa"),
icon: Map,
- path: '/map',
+ path: "/map",
callback: () => {
- if (mapPositionMode !== 'gps') {
+ if (mapPositionMode !== "gps") {
return;
}
- if (!('geolocation' in navigator)) {
+ if (!("geolocation" in navigator)) {
return;
}
@@ -50,20 +50,20 @@ export default function NavBar() {
updateMapState(coords, 16);
}
},
- () => { }
+ () => {},
);
- }
+ },
},
{
- name: t('navbar.settings', 'Ajustes'),
+ name: t("navbar.settings", "Ajustes"),
icon: Settings,
- path: '/settings'
- }
+ path: "/settings",
+ },
];
return (
<nav className="navigation-bar">
- {navItems.map(item => {
+ {navItems.map((item) => {
const Icon = item.icon;
const isActive = location.pathname.startsWith(item.path);
@@ -71,7 +71,7 @@ export default function NavBar() {
<Link
key={item.name}
to={item.path}
- className={`navigation-bar__link ${isActive ? 'active' : ''}`}
+ className={`navigation-bar__link ${isActive ? "active" : ""}`}
onClick={item.callback ? item.callback : undefined}
title={item.name}
aria-label={item.name}