diff --git a/src/components/appointment/index.tsx b/src/components/appointment/index.tsx index 7c9cb37..fd56a89 100644 --- a/src/components/appointment/index.tsx +++ b/src/components/appointment/index.tsx @@ -1,8 +1,9 @@ -import { t } from "../../i18n/translations"; import { useI18nStore } from "../../i18n/store"; +import { useI18n } from "../../i18n/hook/useI18n"; export function Appointment() { const language = useI18nStore((state) => state.language); + const t = useI18n(); const options: Intl.DateTimeFormatOptions = { weekday: "long", @@ -24,11 +25,11 @@ export function Appointment() { <> {appointment ? (

- {t("your-appointment", language)}: + {t("your-appointment")}:
{dateTimeFormat.format(appointment!)}
- {t("address", language)}: + {t("address")}:
Schlesische Straße 27A, 10997 Berlin ( - {t("plan-route", language)} + {t("plan-route")} )

) : (

- {t("intro.p2", language)} + {t("intro.p2")}
- {t("intro.p2.link", language)} + {t("intro.p2.link")}

)} diff --git a/src/components/buttons/home-button/index.tsx b/src/components/buttons/home-button/index.tsx index 428e59b..db3625b 100644 --- a/src/components/buttons/home-button/index.tsx +++ b/src/components/buttons/home-button/index.tsx @@ -1,12 +1,12 @@ import { useProgressStore } from "../../steps/store"; -import { useI18nStore } from "../../../i18n/store"; -import { t } from "../../../i18n/translations"; +import { useI18n } from "../../../i18n/hook/useI18n"; export function HomeButton() { const goToStart = useProgressStore((state) => state.goToStart); - const language = useI18nStore((state) => state.language); const currentStep = useProgressStore((state) => state.currentStep); + const t = useI18n(); + const isHomeButtonHidden = currentStep === 0; return ( @@ -33,10 +33,8 @@ export function HomeButton() { /> - {t("start.mobile", language)} - - {t("start.desktop", language)} - + {t("start.mobile")} + {t("start.desktop")} ); diff --git a/src/components/feedback/index.tsx b/src/components/feedback/index.tsx index 056af43..79e74c4 100644 --- a/src/components/feedback/index.tsx +++ b/src/components/feedback/index.tsx @@ -1,22 +1,21 @@ -import { t } from "../../i18n/translations"; -import { useI18nStore } from "../../i18n/store"; +import { useI18n } from "../../i18n/hook/useI18n"; export function Feedback() { - const language = useI18nStore((state) => state.language); + const t = useI18n(); return ( <>

- {t("feedback.intro", language)}
{" "} - {t("feedback.question", language)}{" "} + {t("feedback.intro")}
{" "} + {t("feedback.question")}{" "} - {t("feedback.link.label", language)} + {t("feedback.link.label")}

diff --git a/src/components/footer/index.tsx b/src/components/footer/index.tsx index ba1c06e..b820820 100644 --- a/src/components/footer/index.tsx +++ b/src/components/footer/index.tsx @@ -1,10 +1,9 @@ -import { t } from "../../i18n/translations"; -import { useI18nStore } from "../../i18n/store"; import { useProgressStore } from "../steps/store"; +import { useI18n } from "../../i18n/hook/useI18n.tsx"; export function Footer() { - const language = useI18nStore((state) => state.language); const currentStep = useProgressStore((state) => state.currentStep); + const t = useI18n(); return (