From a68ba30716062b265f85c4be078a736c7135d7bc Mon Sep 17 00:00:00 2001 From: Ariel Costas Guerrero Date: Sun, 30 Nov 2025 20:49:48 +0100 Subject: Refactor StopMap and Settings components; replace region config usage with REGION_DATA, update StopDataProvider calls, and improve UI elements. Remove unused timetable files and add Tailwind CSS support. --- src/frontend/app/routes/settings.tsx | 132 +++++------------------------------ 1 file changed, 17 insertions(+), 115 deletions(-) (limited to 'src/frontend/app/routes/settings.tsx') diff --git a/src/frontend/app/routes/settings.tsx b/src/frontend/app/routes/settings.tsx index 351ccf0..faad5a6 100644 --- a/src/frontend/app/routes/settings.tsx +++ b/src/frontend/app/routes/settings.tsx @@ -1,76 +1,41 @@ -import { useState } from "react"; +import { Computer, Moon, Sun } from "lucide-react"; import { useTranslation } from "react-i18next"; -import { useNavigate } from "react-router"; import { usePageTitle } from "~/contexts/PageTitleContext"; import { type Theme, useApp } from "../AppContext"; -import { getAvailableRegions } from "../config/RegionConfig"; import "./settings.css"; export default function Settings() { const { t, i18n } = useTranslation(); usePageTitle(t("navbar.settings", "Ajustes")); - const navigate = useNavigate(); const { theme, setTheme, - tableStyle, - setTableStyle, mapPositionMode, - setMapPositionMode, - region, - setRegion, + setMapPositionMode } = useApp(); - const regions = getAvailableRegions(); - const [showModal, setShowModal] = useState(false); - const [pendingRegion, setPendingRegion] = useState(null); - - const handleRegionChange = (newRegion: string) => { - if (newRegion !== region) { - setPendingRegion(newRegion); - setShowModal(true); - } - }; - - const confirmRegionChange = () => { - if (pendingRegion) { - setRegion(pendingRegion as any); - setShowModal(false); - setPendingRegion(null); - navigate("/"); - } - }; - - const cancelRegionChange = () => { - setShowModal(false); - setPendingRegion(null); - }; - return (

{t("about.settings")}

-
- - -
+
+ +
+ + + +
+
+
-
- - -
-
- {t("about.details_summary")} -

{t("about.details_table")}

-
-
{t("about.table_style_regular")}
-
{t("about.details_regular")}
-
{t("about.table_style_grouped")}
-
{t("about.details_grouped")}
-
{t("about.table_style_experimental_consolidated")}
-
{t("about.details_experimental_consolidated")}
-
-
- - {showModal && ( -
-
e.stopPropagation()}> -

{t("about.region_change_title", "Cambiar región")}

-

- {t( - "about.region_change_message", - "¿Estás seguro de que quieres cambiar la región? Serás redirigido a la lista de paradas." - )} -

-
- - -
-
-
- )}
); } -- cgit v1.3