refactor: replace react-hot-toast with custom toast component, introduce SubmitButton for forms, and migrate status messages to toasts

This commit is contained in:
poyrazavsever
2026-06-09 00:18:46 +03:00
parent b838c94be2
commit 6b48da58bf
12 changed files with 3452 additions and 882 deletions
+1 -1
View File
@@ -115,7 +115,7 @@ export function AuthPageShell({
<div className="w-full relative z-10 p-10 text-sm text-primary-foreground/78">
<span>Açık kaynak ve self-host edilebilir.</span>{" "}
<Link
href="https://github.com/poyrazavsever/cognis"
href="https://github.com/poyrazavsever/revanios"
className="font-semibold text-primary-foreground underline-offset-4 hover:underline"
target="_blank"
>
+31
View File
@@ -0,0 +1,31 @@
"use client";
import { useFormStatus } from "react-dom";
import { Button } from "poyraz-ui/atoms";
import { Loader2 } from "lucide-react";
import React from "react";
interface SubmitButtonProps extends React.ComponentProps<typeof Button> {
pendingText?: string;
}
export function SubmitButton({
children,
pendingText,
...props
}: SubmitButtonProps) {
const { pending } = useFormStatus();
return (
<Button disabled={pending} {...props}>
{pending ? (
<>
<Loader2 className="h-4 w-4 animate-spin" />
{pendingText || children}
</>
) : (
children
)}
</Button>
);
}
+1 -1
View File
@@ -1,7 +1,7 @@
'use client'
import { useEffect } from 'react'
import { toast } from 'react-hot-toast'
import { toast } from 'poyraz-ui/molecules'
export function ErrorToaster({ message }: { message: string }) {
useEffect(() => {