From cb97919157cfd32543ec4f8a0dc50c99403aae6f Mon Sep 17 00:00:00 2001 From: Marco Pedone Date: Tue, 20 Jan 2026 15:30:25 +0100 Subject: [PATCH] feat: enhance contact modal and guide components with translation support; update pricing display and improve accessibility --- .../annuncio-interactions/contatto_modal.tsx | 15 +++-- .../src/components/expand_guida.tsx | 46 +++----------- apps/infoalloggi/src/components/prezzi.tsx | 2 +- apps/infoalloggi/src/i18n/en.ts | 53 +++++++++++++++- apps/infoalloggi/src/i18n/it.ts | 51 +++++++++++++++ apps/infoalloggi/src/i18n/locales.ts | 27 ++++++++ apps/infoalloggi/src/pages/annuncio/[cod].tsx | 63 +++++++++++-------- 7 files changed, 188 insertions(+), 69 deletions(-) diff --git a/apps/infoalloggi/src/components/annuncio-interactions/contatto_modal.tsx b/apps/infoalloggi/src/components/annuncio-interactions/contatto_modal.tsx index 6afb630..def688f 100644 --- a/apps/infoalloggi/src/components/annuncio-interactions/contatto_modal.tsx +++ b/apps/infoalloggi/src/components/annuncio-interactions/contatto_modal.tsx @@ -11,22 +11,27 @@ import { import { Button } from "~/components/ui/button"; import { FormContattoAnnucio } from "~/forms/FormContattoAnnuncio"; import { useAnnuncio } from "~/providers/AnnuncioProvider"; +import { useTranslation } from "~/providers/I18nProvider"; export const ContattoAnnuncio = () => { const { codice } = useAnnuncio(); - + const { t } = useTranslation(); return ( - - Contattaci per avere informazioni + {t.contatto.annuncio_cta.title} - Ti contatteremo il prima possibile per darti più informazioni + {t.contatto.annuncio_cta.description} diff --git a/apps/infoalloggi/src/components/expand_guida.tsx b/apps/infoalloggi/src/components/expand_guida.tsx index 0bc66ca..de5b1f6 100644 --- a/apps/infoalloggi/src/components/expand_guida.tsx +++ b/apps/infoalloggi/src/components/expand_guida.tsx @@ -1,5 +1,6 @@ import { HelpCircle } from "lucide-react"; import Link from "next/link"; +import { useTranslation } from "~/providers/I18nProvider"; import { ExpandableScreen, ExpandableScreenContent, @@ -8,39 +9,8 @@ import { import { Button } from "./ui/button"; import { Separator } from "./ui/separator"; -const texts: { - title: string; - parts: (string | { href: string; text: string })[]; -}[] = [ - { - title: "Costo del servizio", - parts: [ - "Il costo del servizio è personalizzato in base alla tipologia e parametri della tua ricerca.", - "Per contattare i proprietari ti chiederemo un acconto di 35€ sul totale.", - "Potrai contattare tutti i proprietari degli immobili che desideri durante la durata del servizio.", - { href: "/prezzi", text: "Scopri i prezzi" }, - ], - }, - { - title: "Come procedere", - parts: [ - "Contattaci per un immobile, prepareremo per te degli annunci compatibili alle tue esigenze e ti invieremo un invito via email per accedere alla piattaforma.", - "Una volta effettuato l'accesso, potrai acquistare il servizio e visualizzare i contatti dei proprietari degli immobili.", - { - href: "/annunci", - text: "Vai agli annunci", - }, - ], - }, - { - title: "Nulla di fatto", - parts: [ - "Se non trovi un immobile che soddisfi le tue esigenze, avrai 14 giorni di tempo per interrompere il servizio senza necessità di ulteriori pagamenti.", - ], - }, -]; - export const ComeFunziona = () => { + const { t } = useTranslation(); return ( { triggerRadius="100px" > - - +
- {texts.map((text, index) => ( + {t.come_funziona_guida.features.map((text, index) => ( // biome-ignore lint/suspicious/noArrayIndexKey:
diff --git a/apps/infoalloggi/src/components/prezzi.tsx b/apps/infoalloggi/src/components/prezzi.tsx index 3f83653..9c8b710 100644 --- a/apps/infoalloggi/src/components/prezzi.tsx +++ b/apps/infoalloggi/src/components/prezzi.tsx @@ -153,7 +153,7 @@ export const PricingComponent = ({ data-role="wrapper" >
-

+

{t.acconto}

{ - Codice {data.codice} + {t.annunci.codice} {data.codice} @@ -449,7 +449,7 @@ const CardInfos = ({ data }: { data: Annunci }) => {

{data.prezzo && (data.prezzo / 1e2).toFixed(2).replace(".", ",")}{" "} - €/mese + {t.annunci.euro_mese}
{data.prezzo && ( { >
- Prezzo al giorno + {t.annunci.prezzo_giorno}
- {(data.prezzo / 1e2 / 30).toFixed(2).replace(".", ",")} €/gg + {(data.prezzo / 1e2 / 30).toFixed(2).replace(".", ",")}{" "} + {t.annunci.euro_giorno}
@@ -487,7 +488,7 @@ const CardInfos = ({ data }: { data: Annunci }) => {
-

Fornitura:

+

{t.annunci.fornitura}:

@@ -501,7 +502,9 @@ const CardInfos = ({ data }: { data: Annunci }) => {
- {data.numero_bagni || 0} bagni + + {data.numero_bagni || 0} {t.annunci.bagni} +
@@ -509,12 +512,14 @@ const CardInfos = ({ data }: { data: Annunci }) => {
- {data.numero_postiauto || 0} posti auto + + {data.numero_postiauto || 0} {t.annunci.posti_auto} +
-

Dati immobile:

+

{t.annunci.dati_immobile}:

@@ -525,15 +530,20 @@ const CardInfos = ({ data }: { data: Annunci }) => {
- - - {(() => { - if (data.piano === "0") return "piano terra"; - if (data.piano === "0.5") return "piano rialz."; - if (data.piano) return `${data.piano}° piano`; - return ""; - })()} - + {data.piano !== null && data.piano !== "" && ( + <> + + + {(() => { + if (data.piano === "0") return t.annunci.p_terra; + if (data.piano === "0.5") return t.annunci.p_rialzato; + if (data.piano) + return `${data.piano}° ${t.annunci.piano}`; + return "--"; + })()} + + + )}
@@ -542,12 +552,12 @@ const CardInfos = ({ data }: { data: Annunci }) => { {data.stato === "Trattativa" ? (
- Annuncio in aggiornamento + {t.annunci.in_aggiornamento}
) : (
- Disponibilità:{" "} + {t.annunci.disponibile}:{" "} {handleConsegna({ aggiornamento: t.card.in_aggiornamento, @@ -656,6 +666,7 @@ const AnnuncioFooter = ({ external_videos: string[]; updated_at: Date | null; }) => { + const { t } = useTranslation(); return (

Video:

@@ -698,15 +709,15 @@ const AnnuncioFooter = ({ href={{ pathname: "/annunci", query: { - comune: comune, - consegna: consegna, - tipo: tipo, + c: comune, + f: consegna, + t: tipo, }, }} target="_blank" > -