refactor: update Test component to simplify button actions and integrate toast notifications
This commit is contained in:
parent
6d69e6c037
commit
8c802dcabf
2 changed files with 8 additions and 27 deletions
|
|
@ -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 }} />
|
||||
)}
|
||||
|
|
|
|||
|
|
@ -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>
|
||||
);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue