refactor: update Test component to simplify button actions and integrate toast notifications

This commit is contained in:
Marco Pedone 2025-09-09 15:07:23 +02:00
parent 6d69e6c037
commit 8c802dcabf
2 changed files with 8 additions and 27 deletions

View file

@ -72,7 +72,11 @@ const MyApp = ({
}
`}</style>
<Toaster position="top-right" reverseOrder={false} />
<Toaster
containerClassName="mt-10"
position="top-right"
reverseOrder={false}
/>
{!router.pathname.startsWith("/annunci") && (
<NextNProgress options={{ showSpinner: false }} />
)}

View file

@ -1,35 +1,12 @@
import type { NextPage } from "next";
import toast from "react-hot-toast";
import { Button } from "~/components/ui/button";
import { api } from "~/utils/api";
const Test: NextPage = () => {
const { mutate } = api.test.testErr.useMutation();
return (
<div className="flex gap-4 p-4">
<Button onClick={() => console.log("test console.log")} type="button">
test console.log
</Button>
<Button onClick={() => console.info("test console.info")} type="button">
test console.info
</Button>
<Button onClick={() => console.error("test console.error")} type="button">
test console.error
</Button>
<Button
onClick={() => {
throw new Error("test Error");
}}
type="button"
>
test Error
</Button>
<Button
onClick={() => {
mutate();
}}
type="button"
>
Server
<Button onClick={() => toast.success("asdasdasdasdasda")} type="button">
test
</Button>
</div>
);