diff --git a/apps/infoalloggi/src/components/MapDialog.tsx b/apps/infoalloggi/src/components/MapDialog.tsx index 8d88a14..c588d8a 100644 --- a/apps/infoalloggi/src/components/MapDialog.tsx +++ b/apps/infoalloggi/src/components/MapDialog.tsx @@ -30,10 +30,10 @@ export const MappaDialogFullscreen = ({ - + {t.mappa} {t.mappa} diff --git a/apps/infoalloggi/src/components/annunci_tutorial.tsx b/apps/infoalloggi/src/components/annunci_tutorial.tsx index e929833..d797199 100644 --- a/apps/infoalloggi/src/components/annunci_tutorial.tsx +++ b/apps/infoalloggi/src/components/annunci_tutorial.tsx @@ -55,7 +55,7 @@ export const CTA_TipologiaModal = () => { > */} diff --git a/apps/infoalloggi/src/components/annuncio-interactions/contatto_modal.tsx b/apps/infoalloggi/src/components/annuncio-interactions/contatto_modal.tsx index 350f330..6afb630 100644 --- a/apps/infoalloggi/src/components/annuncio-interactions/contatto_modal.tsx +++ b/apps/infoalloggi/src/components/annuncio-interactions/contatto_modal.tsx @@ -19,7 +19,7 @@ export const ContattoAnnuncio = () => { diff --git a/apps/infoalloggi/src/components/area-riservata/sidebar.tsx b/apps/infoalloggi/src/components/area-riservata/sidebar.tsx index 2c2c909..61a3312 100644 --- a/apps/infoalloggi/src/components/area-riservata/sidebar.tsx +++ b/apps/infoalloggi/src/components/area-riservata/sidebar.tsx @@ -71,11 +71,7 @@ export const Sidebar = ({ onClick={() => toggleSidebar(!minimized)} variant="ghost" > - {minimized ? ( - - ) : ( - - )} + {minimized ? : } Toggle Menu diff --git a/apps/infoalloggi/src/components/expand_guida.tsx b/apps/infoalloggi/src/components/expand_guida.tsx index 22c7ddf..0bc66ca 100644 --- a/apps/infoalloggi/src/components/expand_guida.tsx +++ b/apps/infoalloggi/src/components/expand_guida.tsx @@ -49,7 +49,7 @@ export const ComeFunziona = () => { > diff --git a/apps/infoalloggi/src/components/navbar/login-button.tsx b/apps/infoalloggi/src/components/navbar/login-button.tsx index bb7ec22..191aa7d 100644 --- a/apps/infoalloggi/src/components/navbar/login-button.tsx +++ b/apps/infoalloggi/src/components/navbar/login-button.tsx @@ -76,7 +76,7 @@ export const UserHeaderSection = ({ > {inSidebar && t.auth.login.titolo} - + ) : ( diff --git a/apps/infoalloggi/src/components/navbar/ricerca_command.tsx b/apps/infoalloggi/src/components/navbar/ricerca_command.tsx index fac8654..c6140af 100644 --- a/apps/infoalloggi/src/components/navbar/ricerca_command.tsx +++ b/apps/infoalloggi/src/components/navbar/ricerca_command.tsx @@ -27,7 +27,7 @@ export function RicercaCommand() { diff --git a/apps/infoalloggi/src/components/navbar/settings-modal.tsx b/apps/infoalloggi/src/components/navbar/settings-modal.tsx index 9c0f6f9..6b21345 100644 --- a/apps/infoalloggi/src/components/navbar/settings-modal.tsx +++ b/apps/infoalloggi/src/components/navbar/settings-modal.tsx @@ -14,7 +14,7 @@ export const SettingsPopover = () => { diff --git a/apps/infoalloggi/src/components/onboard_tutorial.tsx b/apps/infoalloggi/src/components/onboard_tutorial.tsx index baa5570..1324303 100644 --- a/apps/infoalloggi/src/components/onboard_tutorial.tsx +++ b/apps/infoalloggi/src/components/onboard_tutorial.tsx @@ -109,7 +109,7 @@ export const OnboardTutorial = () => { diff --git a/apps/infoalloggi/src/components/prezzi.tsx b/apps/infoalloggi/src/components/prezzi.tsx index 6fc0f32..3f83653 100644 --- a/apps/infoalloggi/src/components/prezzi.tsx +++ b/apps/infoalloggi/src/components/prezzi.tsx @@ -40,13 +40,13 @@ export const PricingChoice = () => { Transitorio Stabile @@ -86,7 +86,7 @@ export const PricingChoice = () => { diff --git a/apps/infoalloggi/src/components/servizio/admin_conferma.tsx b/apps/infoalloggi/src/components/servizio/admin_conferma.tsx index 7bcbaa7..3e0d5a4 100644 --- a/apps/infoalloggi/src/components/servizio/admin_conferma.tsx +++ b/apps/infoalloggi/src/components/servizio/admin_conferma.tsx @@ -66,14 +66,11 @@ export const AdminLavoraConferma = () => { @@ -823,7 +820,7 @@ const SendConferma = () => { )} - +
{!docOk && ( diff --git a/apps/infoalloggi/src/components/servizio/admin_contratto.tsx b/apps/infoalloggi/src/components/servizio/admin_contratto.tsx index 54bd315..7a13294 100644 --- a/apps/infoalloggi/src/components/servizio/admin_contratto.tsx +++ b/apps/infoalloggi/src/components/servizio/admin_contratto.tsx @@ -38,13 +38,10 @@ export const AdminContratto = () => { diff --git a/apps/infoalloggi/src/components/servizio/annuncio_actions.tsx b/apps/infoalloggi/src/components/servizio/annuncio_actions.tsx index e578c40..902ebd4 100644 --- a/apps/infoalloggi/src/components/servizio/annuncio_actions.tsx +++ b/apps/infoalloggi/src/components/servizio/annuncio_actions.tsx @@ -1,19 +1,35 @@ -import { ExternalLink, FolderKanban, ShieldUser, Trash2 } from "lucide-react"; -import Link from "next/link"; -import toast from "react-hot-toast"; -import { Confirm } from "~/components/confirm"; -import { Button } from "~/components/ui/button"; import { - Popover, - PopoverContent, - PopoverTrigger, -} from "~/components/ui/popover"; + ExternalLink, + Eye, + FileBadge, + FileText, + FolderKanban, + PackageCheck, + Pointer, + Printer, + Trash2, +} from "lucide-react"; +import Link from "next/link"; +import { useRouter } from "next/router"; +import toast from "react-hot-toast"; +import { Button, type ButtonConfigs } from "~/components/ui/button"; +import { + Tooltip, + TooltipContent, + TooltipProvider, + TooltipTrigger, +} from "~/components/ui/tooltip"; +import { cn } from "~/lib/utils"; import { useServizio, useServizioAnnuncio } from "~/providers/ServizioProvider"; +import type { AnnunciId } from "~/schemas/public/Annunci"; import { api } from "~/utils/api"; +import { Confirm } from "../confirm"; import { AdminLavoraConferma } from "./admin_conferma"; import { AdminContratto } from "./admin_contratto"; +import { ConfermaAnnuncioModal, ConfermaInLavorazioneModal } from "./conferma"; +import { ContattiProprietarioModal } from "./modale_contatti"; -export const AnnuncioActions = () => { +export const AdminActions = () => { const { servizioId, userId, isAdmin } = useServizio(); const { data, annuncioId } = useServizioAnnuncio(); @@ -31,79 +47,330 @@ export const AnnuncioActions = () => { toast.success("Annuncio rimosso"); }, }); + if (!isAdmin) return null; - if ((!isAdmin && data.open_contatti_at == null) || isAdmin) { - return ( -
- {isAdmin && data.user_confirmed_at != null && } - {isAdmin && data.accettato_conferma_at != null && ( - <> - - {data.gestionale_id && ( - - - - )} - - )} - {isAdmin && ( - - - - - + {data.user_confirmed_at != null && } + {data.accettato_conferma_at != null && ( + <> + + {data.gestionale_id && ( + - - - + + + )} + + )} + + + + + + - { - mutate({ - annuncioId, - servizioId, - }); - }} - title="Elimina annuncio" - > - - - - + + + + + { + mutate({ + annuncioId, + servizioId, + }); + }} + title="Elimina annuncio" + > + + +
+ ); +}; + +export const UserActions = () => { + const { servizioId } = useServizio(); + const { data, annuncioId } = useServizioAnnuncio(); + + const ContattiSbloccati = data.open_contatti_at !== null; + const ConfermaUtente = data.user_confirmed_at !== null; + const ConfermaLavorata = data.doc_conferma_added && data.hasConfermaAdmin; + const AccettatoConferma = data.accettato_conferma_at !== null; + + return ( + <> +
+ + + {ContattiSbloccati && !ConfermaUtente && } + {ConfermaUtente && !data.hasConfermaAdmin && ( + )} + {AccettatoConferma && ( + + + + )} + {ConfermaLavorata && + (data.doc_conferma_ref ? ( + + + + ) : ( + + + + + + +

Il documento non è più disponibile

+

+ Se hai bisogno di una copia, contattaci via email o chat. +

+
+
+
+ ))} +
+ + {data.accettato_conferma_at != null && } + + ); +}; + +const PostConfermaSection = () => { + const { servizio, servizioId } = useServizio(); + const { data, annuncioId } = useServizioAnnuncio(); + + const saldoPaid = servizio.isOkSaldo; + const consulenzaPaid = servizio.isOkConsulenza; + + if (!saldoPaid) { + return ( +
+

+ Questo annuncio è stato confermato, procedi al saldo: +

+
); } - return null; + if (!data.doc_contratto_added) { + return ( +
+

+ Ci siamo quasi! Stiamo preparando il contratto per te. +

+

+ Una volta pronto, riceverai una notifica via email. +

+
+ ); + } + + return ( +
+

+ {consulenzaPaid + ? "Il contratto è pronto, puoi visualizzarlo:" + : "Il contratto è pronto, puoi visualizzarlo e procedere al saldo:"} +

+
+ {data.doc_contratto_ref ? ( + + + + ) : ( + + + + + + +

Il documento non è più disponibile

+

Se hai bisogno di una copia, contattaci via email o chat.

+
+
+
+ )} + + {!consulenzaPaid && data.contratto_tipo && } + + {data.doc_registrazione_added && + (data.doc_registrazione_ref ? ( + + + + ) : ( + + + + + + +

Il documento non è più disponibile

+

+ Se hai bisogno di una copia, contattaci via email o chat. +

+
+
+
+ ))} +
+
+ ); +}; + +export const SaldoButton = ({ + annuncioId, + variant = "info", + className, +}: { + annuncioId: AnnunciId; + variant?: ButtonConfigs["variant"]; + className?: string; +}) => { + const { servizioId } = useServizio(); + const router = useRouter(); + + const { mutate } = api.servizio.setupSaldoServizio.useMutation({ + onMutate: () => { + toast.loading("Caricamento ...", { id: "preparazioneSaldo" }); + }, + onSuccess: async (data) => { + toast.success("Pagamento saldo preparato", { + id: "preparazioneSaldo", + }); + + await router.push(`/servizio/pagamento/${data}`); + }, + }); + return ( + + ); +}; + +const SaldoConsulenzaButton = ({ + variant = "info", + className, +}: { + variant?: ButtonConfigs["variant"]; + className?: string; +}) => { + const { annuncioId } = useServizioAnnuncio(); + const { servizioId } = useServizio(); + const router = useRouter(); + + const { mutate } = api.servizio.setupSaldoConsulenzaServizio.useMutation({ + onMutate: () => { + toast.loading("Caricamento ...", { id: "preparazioneSaldo" }); + }, + onSuccess: async (data) => { + toast.success("Pagamento saldo preparato", { + id: "preparazioneSaldo", + }); + + await router.push(`/servizio/pagamento/${data}`); + }, + }); + return ( + + ); }; diff --git a/apps/infoalloggi/src/components/servizio/annuncio_card.tsx b/apps/infoalloggi/src/components/servizio/annuncio_card.tsx index bcc3f25..22d419e 100644 --- a/apps/infoalloggi/src/components/servizio/annuncio_card.tsx +++ b/apps/infoalloggi/src/components/servizio/annuncio_card.tsx @@ -1,12 +1,14 @@ import Image from "next/image"; -import { AnnuncioActions } from "~/components/servizio/annuncio_actions"; -import { Interactions } from "~/components/servizio/interactions"; +import { + AdminActions, + UserActions, +} from "~/components/servizio/annuncio_actions"; import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card"; import { handleConsegna } from "~/lib/annuncio_details"; import { getStorageUrl } from "~/lib/storage_utils"; import { cn, formatCurrency } from "~/lib/utils"; import { useTranslation } from "~/providers/I18nProvider"; -import { useServizioAnnuncio } from "~/providers/ServizioProvider"; +import { useServizio, useServizioAnnuncio } from "~/providers/ServizioProvider"; import type { AnnuncioRicerca } from "~/server/controllers/annunci.controller"; import { AnnuncioDettaglio, TipoBadge } from "./annuncio_dettaglio"; @@ -17,11 +19,11 @@ export const AnnuncioCard = ({ className?: string; confirming?: boolean; }) => { + const { isAdmin } = useServizio(); const { data } = useServizioAnnuncio(); return ( } className={className} confirming={confirming} data={{ @@ -31,7 +33,7 @@ export const AnnuncioCard = ({ ? new Date(data.media_updated_at) : null, }} - interactions={} + interactions={isAdmin ? : } /> ); }; @@ -103,13 +105,11 @@ export const AnnuncioDisplay = ({ }; export const BasicAnnuncioCard = ({ - actions, interactions, className, data, confirming, }: { - actions?: React.ReactNode; interactions?: React.ReactNode; className?: string; data: AnnuncioRicerca; @@ -119,7 +119,6 @@ export const BasicAnnuncioCard = ({ Annuncio {data.codice} - {actions}
{ @@ -218,7 +218,7 @@ export const ConfermaInLavorazioneModal = () => { aria-label="Conferma in lavorazione" className="w-full sm:w-fit" > - + Conferma in lavorazione diff --git a/apps/infoalloggi/src/components/servizio/interactions.tsx b/apps/infoalloggi/src/components/servizio/interactions.tsx deleted file mode 100644 index 2bd396f..0000000 --- a/apps/infoalloggi/src/components/servizio/interactions.tsx +++ /dev/null @@ -1,286 +0,0 @@ -import { FileBadge, FileText, PackageCheck, Pointer } from "lucide-react"; -import Link from "next/link"; -import { useRouter } from "next/router"; -import toast from "react-hot-toast"; -import { Button, type ButtonConfigs } from "~/components/ui/button"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "~/components/ui/tooltip"; -import { cn } from "~/lib/utils"; -import { useServizio, useServizioAnnuncio } from "~/providers/ServizioProvider"; -import type { AnnunciId } from "~/schemas/public/Annunci"; -import { api } from "~/utils/api"; -import { ConfermaAnnuncioModal, ConfermaInLavorazioneModal } from "./conferma"; -import { ContattiProprietarioModal } from "./modale_contatti"; - -const SezioneConferma = () => { - const { servizioId } = useServizio(); - const { data, annuncioId } = useServizioAnnuncio(); - - const ContattiSbloccati = data.open_contatti_at !== null; - const ConfermaUtente = data.user_confirmed_at !== null; - const ConfermaLavorata = data.doc_conferma_added && data.hasConfermaAdmin; - const AccettatoConferma = data.accettato_conferma_at !== null; - - if (ContattiSbloccati && !ConfermaUtente) { - return ; - } - - if (ConfermaUtente && !data.hasConfermaAdmin) { - return ; - } - if (AccettatoConferma) { - return ( - - - - ); - } - if (ConfermaLavorata) { - if (data.doc_conferma_ref) { - return ( - - - - ); - } - return ( - - - - - - -

Il documento non è più disponibile

-

Se hai bisogno di una copia, contattaci via email o chat.

-
-
-
- ); - } - - return null; -}; - -const PostConfermaSection = () => { - const { servizio, servizioId } = useServizio(); - const { data, annuncioId } = useServizioAnnuncio(); - - const saldoPaid = servizio.isOkSaldo; - const consulenzaPaid = servizio.isOkConsulenza; - - if (!saldoPaid) { - return ( -
-

- Questo annuncio è stato confermato, procedi al saldo: -

- -
- ); - } - if (!data.doc_contratto_added) { - return ( -
-

- Ci siamo quasi! Stiamo preparando il contratto per te. -

-

- Una volta pronto, riceverai una notifica via email. -

-
- ); - } - - return ( -
-

- {consulenzaPaid - ? "Il contratto è pronto, puoi visualizzarlo:" - : "Il contratto è pronto, puoi visualizzarlo e procedere al saldo:"} -

-
- {data.doc_contratto_ref ? ( - - - - ) : ( - - - - - - -

Il documento non è più disponibile

-

Se hai bisogno di una copia, contattaci via email o chat.

-
-
-
- )} - - {!consulenzaPaid && data.contratto_tipo && } - - {data.doc_registrazione_added && - (data.doc_registrazione_ref ? ( - - - - ) : ( - - - - - - -

Il documento non è più disponibile

-

- Se hai bisogno di una copia, contattaci via email o chat. -

-
-
-
- ))} -
-
- ); -}; - -export const Interactions = () => { - const { data } = useServizioAnnuncio(); - - return ( - <> -
- - - -
- - {data.accettato_conferma_at != null && } - - ); -}; - -export const SaldoButton = ({ - annuncioId, - variant = "info", - className, -}: { - annuncioId: AnnunciId; - variant?: ButtonConfigs["variant"]; - className?: string; -}) => { - const { servizioId } = useServizio(); - const router = useRouter(); - - const { mutate } = api.servizio.setupSaldoServizio.useMutation({ - onMutate: () => { - toast.loading("Caricamento ...", { id: "preparazioneSaldo" }); - }, - onSuccess: async (data) => { - toast.success("Pagamento saldo preparato", { - id: "preparazioneSaldo", - }); - - await router.push(`/servizio/pagamento/${data}`); - }, - }); - return ( - - ); -}; - -const SaldoConsulenzaButton = ({ - variant = "info", - className, -}: { - variant?: ButtonConfigs["variant"]; - className?: string; -}) => { - const { annuncioId } = useServizioAnnuncio(); - const { servizioId } = useServizio(); - const router = useRouter(); - - const { mutate } = api.servizio.setupSaldoConsulenzaServizio.useMutation({ - onMutate: () => { - toast.loading("Caricamento ...", { id: "preparazioneSaldo" }); - }, - onSuccess: async (data) => { - toast.success("Pagamento saldo preparato", { - id: "preparazioneSaldo", - }); - - await router.push(`/servizio/pagamento/${data}`); - }, - }); - return ( - - ); -}; diff --git a/apps/infoalloggi/src/components/servizio/main.tsx b/apps/infoalloggi/src/components/servizio/main.tsx index 270b146..b74aeef 100644 --- a/apps/infoalloggi/src/components/servizio/main.tsx +++ b/apps/infoalloggi/src/components/servizio/main.tsx @@ -4,11 +4,11 @@ import Link from "next/link"; import { useRouter } from "next/router"; import { useEffect } from "react"; import toast from "react-hot-toast"; +import { SaldoButton } from "~/components/servizio/annuncio_actions"; import { AnnuncioCard, AnnuncioDisplay, } from "~/components/servizio/annuncio_card"; -import { SaldoButton } from "~/components/servizio/interactions"; import { ServizioActions } from "~/components/servizio/servizio_actions"; import { Button } from "~/components/ui/button"; import { @@ -65,7 +65,30 @@ const ServizioCard = ({ export const ServizioContent = () => { const { servizio, isAdmin, userId, servizioId } = useServizio(); - + const utils = api.useUtils(); + const { mutate: updateServizio } = api.servizio.updateServizio.useMutation({ + onError: (error) => { + toast.error(error.message); + }, + onSuccess: async () => { + toast.success("Servizio modificato con successo"); + await utils.servizio.getAllServizioAnnunci.invalidate({ userId }); + await utils.servizio.getPacksSolution.invalidate({ servizioId }); + }, + }); + const { mutate } = api.servizio.removeAnnuncioServizio.useMutation({ + onError: (error) => { + console.error(error); + toast.error("Errore durante la rimozione dell'annuncio"); + }, + onSuccess: async () => { + await utils.servizio.getAllServizioAnnunci.invalidate({ userId }); + await utils.servizio.getCompatibileAnnunci.invalidate({ + servizioId, + }); + toast.success("Annuncio rimosso"); + }, + }); const router = useRouter(); useEffect(() => { const id = router.asPath.split("#")[1]; @@ -115,30 +138,6 @@ export const ServizioContent = () => { } if (!servizio.isOkAcconto || servizio.decorrenza === null) { - const utils = api.useUtils(); - const { mutate: updateServizio } = api.servizio.updateServizio.useMutation({ - onError: (error) => { - toast.error(error.message); - }, - onSuccess: async () => { - toast.success("Servizio modificato con successo"); - await utils.servizio.getAllServizioAnnunci.invalidate({ userId }); - await utils.servizio.getPacksSolution.invalidate({ servizioId }); - }, - }); - const { mutate } = api.servizio.removeAnnuncioServizio.useMutation({ - onError: (error) => { - console.error(error); - toast.error("Errore durante la rimozione dell'annuncio"); - }, - onSuccess: async () => { - await utils.servizio.getAllServizioAnnunci.invalidate({ userId }); - await utils.servizio.getCompatibileAnnunci.invalidate({ - servizioId, - }); - toast.success("Annuncio rimosso"); - }, - }); return ( { const { servizio } = useServizio(); @@ -47,7 +48,7 @@ export const ContattiProprietarioModal = () => { className="w-full md:w-fit" variant="success" > - + Contatti ) : ( @@ -56,7 +57,7 @@ export const ContattiProprietarioModal = () => { className="w-full md:w-fit" variant="warning" > - + Ottieni i contatti )} @@ -340,7 +341,7 @@ const PostUnlock = () => {

{navigationUrl && ( { return null; }; -export const ServizioPacksInfos = ({ - title = "Prezzi:", -}: { - title?: string; -}) => { +export const ServizioPacksInfos = () => { const { servizio } = useServizio(); const { data: packs } = api.servizio.getPacksSolution.useQuery({ servizioId: servizio.servizio_id, }); + const title = "Prezzi:"; + const sub = "(basati sui parametri di ricerca)"; if (!packs) return null; return (
-

{title}

+
+

{title}

+ {sub} +
{packs.acconto.success ? ( diff --git a/apps/infoalloggi/src/components/servizio/servizio_annunci_accordions.tsx b/apps/infoalloggi/src/components/servizio/servizio_annunci_accordions.tsx index 5baa60b..c5f781d 100644 --- a/apps/infoalloggi/src/components/servizio/servizio_annunci_accordions.tsx +++ b/apps/infoalloggi/src/components/servizio/servizio_annunci_accordions.tsx @@ -31,38 +31,32 @@ export const AnnunciRichiesti = ({ userId }: { userId: UsersId }) => { - Annunci Richiesti: + Annunci Richiesti dall'Utente ({data.length}): -
- {!data || data.length === 0 ? ( -
- - Nessun annuncio compatibile trovato. Amplia la ricerca per - trovare annunci compatibili. - -
- ) : ( - data.map((a) => { - return ( - { - deleteAnnuncio({ annuncioId: a.id, userId }); - }} - variant="destructive" - > - Rimuovi - - - } - key={a.id} - /> - ); - }) +
+ {data.map((a) => { + return ( + { + deleteAnnuncio({ annuncioId: a.id, userId }); + }} + variant="destructive" + > + Rimuovi + + + } + key={a.id} + /> + ); + })} + {data.length % 2 === 1 && ( +
)}
diff --git a/apps/infoalloggi/src/components/ui/button.tsx b/apps/infoalloggi/src/components/ui/button.tsx index 7b21952..2f3c59a 100644 --- a/apps/infoalloggi/src/components/ui/button.tsx +++ b/apps/infoalloggi/src/components/ui/button.tsx @@ -5,7 +5,7 @@ import type * as React from "react"; import { cn } from "~/lib/utils"; const buttonVariants = cva( - "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", + "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all cursor-pointer disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-5 shrink-0 [&_svg]:shrink-0 outline-hidden focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive", { defaultVariants: { size: "default", diff --git a/apps/infoalloggi/src/forms/FormEditServizioAdmin.tsx b/apps/infoalloggi/src/forms/FormEditServizioAdmin.tsx index 41af0ac..a1dc980 100644 --- a/apps/infoalloggi/src/forms/FormEditServizioAdmin.tsx +++ b/apps/infoalloggi/src/forms/FormEditServizioAdmin.tsx @@ -187,7 +187,7 @@ export const FormEditServizio = ({ type="button" variant="destructive" > - + Reset Decorrenza
diff --git a/apps/infoalloggi/src/forms/FormNewServizio.tsx b/apps/infoalloggi/src/forms/FormNewServizio.tsx index be0d597..63f399d 100644 --- a/apps/infoalloggi/src/forms/FormNewServizio.tsx +++ b/apps/infoalloggi/src/forms/FormNewServizio.tsx @@ -488,7 +488,7 @@ export const FormNewServizio = ({ ); @@ -213,7 +213,7 @@ const DrowdownFilters = () => { {nFiltri} - {" "} + {" "} {nFiltri === 1 ? t.annunci.filtro_attivo : t.annunci.filtri_attivi} @@ -246,12 +246,11 @@ const RicercaHeader = () => { > {!map ? ( <> - {" "} - Mappa + Mappa ) : ( <> - +
Lista )} diff --git a/apps/infoalloggi/src/pages/annuncio/[cod].tsx b/apps/infoalloggi/src/pages/annuncio/[cod].tsx index 2697310..d6088b4 100644 --- a/apps/infoalloggi/src/pages/annuncio/[cod].tsx +++ b/apps/infoalloggi/src/pages/annuncio/[cod].tsx @@ -611,7 +611,7 @@ const ShareComponent = () => { diff --git a/apps/infoalloggi/src/pages/servizio/pagamento/[ordineId].tsx b/apps/infoalloggi/src/pages/servizio/pagamento/[ordineId].tsx index cfca2ac..61ae974 100644 --- a/apps/infoalloggi/src/pages/servizio/pagamento/[ordineId].tsx +++ b/apps/infoalloggi/src/pages/servizio/pagamento/[ordineId].tsx @@ -6,7 +6,6 @@ import { LoadingPage } from "~/components/loading"; import { Status500 } from "~/components/status-page"; import { env } from "~/env"; import type { NextPageWithLayout } from "~/pages/_app"; -import { useTranslation } from "~/providers/I18nProvider"; import type { OrdiniOrdineId } from "~/schemas/public/Ordini"; import { TrpcAuthedFetchingIstance } from "~/server/utils/ssgHelper"; import { zOrdineId } from "~/server/utils/zod_types"; @@ -22,7 +21,7 @@ const ServicePurchasePage: NextPageWithLayout = ({ const { data, isLoading } = api.servizio.getServizioPaymentData.useQuery({ ordineId, }); - const { t } = useTranslation(); + const stripePromise = loadStripe(env.NEXT_PUBLIC_STRIPE_PUBLIC_KEY); if (isLoading) { diff --git a/apps/infoalloggi/src/pages/servizio/riapri-conferma/[...slug].tsx b/apps/infoalloggi/src/pages/servizio/riapri-conferma/[...slug].tsx index 595edd3..7b32001 100644 --- a/apps/infoalloggi/src/pages/servizio/riapri-conferma/[...slug].tsx +++ b/apps/infoalloggi/src/pages/servizio/riapri-conferma/[...slug].tsx @@ -69,7 +69,7 @@ const RiapriConferma: NextPageWithLayout = ({ onClick={() => router.back()} variant="secondary" > - + {t.indietro} diff --git a/apps/infoalloggi/src/server/controllers/servizio.controller.ts b/apps/infoalloggi/src/server/controllers/servizio.controller.ts index 14648a5..703ea46 100644 --- a/apps/infoalloggi/src/server/controllers/servizio.controller.ts +++ b/apps/infoalloggi/src/server/controllers/servizio.controller.ts @@ -243,11 +243,12 @@ export const postAcquistoDataHandler = async ({ }: { servizioId: ServizioServizioId; userId: UsersId; - user: Pick; + user: Pick; anagrafica: UsersAnagraficaUpdate; servizio: ServizioUpdate; }): Promise<{ ordineIdForPayment: OrdiniOrdineId | null }> => { try { + console.log("servizio", servizio); const servizioData = await db.transaction().execute(async (tx) => { // Update user and anagrafica data await tx @@ -810,7 +811,7 @@ export const getAllServizioAnnunci = async (userId: UsersId) => { ob.asc().nullsLast(), ) .orderBy("servizio_annunci.open_contatti_at", (ob) => - ob.asc().nullsFirst(), + ob.asc().nullsLast(), ) .orderBy("servizio_annunci.created_at", "asc") .whereRef( @@ -1321,12 +1322,12 @@ export const userSendConfermaIntent = async ({ mailType: "generic", props: { noreply: true, - testo: `La tua conferma per l'immobile con codice ${annuncio_codice.codice} è stata ricevuta. Il nostro team la esaminerà a breve. Riceverai una notifica via email per procedere.`, - title: `Conferma immobile ${annuncio_codice.codice} ricevuta`, + testo: `La tua conferma per l'immobile con codice ${annuncio_codice.codice} è stata inviata con successo. Il nostro team la esaminerà a breve. Riceverai una notifica via email per procedere.`, + title: `Conferma immobile ${annuncio_codice.codice} inviata con successo`, }, }, mail: { - subject: `Conferma immobile ${annuncio_codice.codice} ricevuta`, + subject: `Conferma immobile ${annuncio_codice.codice} inviata con successo`, to: utente.email, }, userId: utente.id,