refactor: simplify button usage in AnnuncioInteractions and ContattoAnnuncio components

This commit is contained in:
Marco Pedone 2025-12-11 15:41:57 +01:00
parent cfbeadb93b
commit 0327957b3b
2 changed files with 6 additions and 5 deletions

View file

@ -4,8 +4,7 @@ import { useRouter } from "next/router";
import toast from "react-hot-toast"; import toast from "react-hot-toast";
import { ContattoAnnuncio } from "~/components/annuncio-interactions/contatto_modal"; import { ContattoAnnuncio } from "~/components/annuncio-interactions/contatto_modal";
import LoadingButton from "~/components/custom_ui/loading-button"; import LoadingButton from "~/components/custom_ui/loading-button";
import { Button, buttonVariants } from "~/components/ui/button"; import { Button } from "~/components/ui/button";
import { cn } from "~/lib/utils";
import { useAnnuncio } from "~/providers/AnnuncioProvider"; import { useAnnuncio } from "~/providers/AnnuncioProvider";
import { useServizio } from "~/providers/ServizioProvider"; import { useServizio } from "~/providers/ServizioProvider";
import type { SessionContextType } from "~/providers/SessionProvider"; import type { SessionContextType } from "~/providers/SessionProvider";
@ -48,13 +47,15 @@ export const AnnuncioInteractions = ({
<span className="w-full text-center text-sm">oppure</span> <span className="w-full text-center text-sm">oppure</span>
<Link <Link
aria-label="Login" aria-label="Login"
className={cn(buttonVariants({ variant: "default" }))}
href={{ href={{
pathname: "/login", pathname: "/login",
query: { redirect: router.asPath }, query: { redirect: router.asPath },
}} }}
> >
<LogIn className="mr-1 size-7" /> Accedi se hai un account <Button className="w-full">
<LogIn />
<span>Accedi se hai un account</span>
</Button>
</Link> </Link>
</div> </div>
)} )}

View file

@ -19,7 +19,7 @@ export const ContattoAnnuncio = () => {
<Credenza> <Credenza>
<CredenzaTrigger asChild> <CredenzaTrigger asChild>
<Button className="w-full" variant="destructive"> <Button className="w-full" variant="destructive">
<MessageCircleQuestion className="size-6" /> Contattaci <MessageCircleQuestion /> Contattaci
</Button> </Button>
</CredenzaTrigger> </CredenzaTrigger>
<CredenzaContent className="max-h-[90vh]"> <CredenzaContent className="max-h-[90vh]">