mirror of
https://github.com/massbug/judge4c.git
synced 2025-05-18 07:16:34 +00:00
rename(components): update file names for consistency
This commit is contained in:
parent
63c0656f25
commit
a33bf167d4
@ -18,8 +18,10 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|||||||
import { signInWithCredentials } from "@/app/actions/auth";
|
import { signInWithCredentials } from "@/app/actions/auth";
|
||||||
import { EyeIcon, EyeOffIcon, MailIcon } from "lucide-react";
|
import { EyeIcon, EyeOffIcon, MailIcon } from "lucide-react";
|
||||||
|
|
||||||
export function CredentialsSignIn() {
|
export type CredentialsSignInFormValues = z.infer<typeof authSchema>;
|
||||||
const form = useForm<z.infer<typeof authSchema>>({
|
|
||||||
|
export function CredentialsSignInForm() {
|
||||||
|
const form = useForm<CredentialsSignInFormValues>({
|
||||||
resolver: zodResolver(authSchema),
|
resolver: zodResolver(authSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
email: "",
|
email: "",
|
||||||
@ -28,15 +30,15 @@ export function CredentialsSignIn() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [isVisible, setIsVisible] = useState<boolean>(false);
|
const [isVisible, setIsVisible] = useState<boolean>(false);
|
||||||
|
|
||||||
const toggleVisibility = () => setIsVisible((prevState) => !prevState);
|
const toggleVisibility = () => setIsVisible((prevState) => !prevState);
|
||||||
|
|
||||||
|
const onSubmit = async (data: CredentialsSignInFormValues) => {
|
||||||
|
await signInWithCredentials(data);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
<form
|
<form onSubmit={form.handleSubmit(onSubmit)} className="grid gap-6">
|
||||||
onSubmit={form.handleSubmit((data) => signInWithCredentials(data))}
|
|
||||||
className="grid gap-6"
|
|
||||||
>
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="email"
|
name="email"
|
@ -18,8 +18,10 @@ import { zodResolver } from "@hookform/resolvers/zod";
|
|||||||
import { signUpWithCredentials } from "@/app/actions/auth";
|
import { signUpWithCredentials } from "@/app/actions/auth";
|
||||||
import { EyeIcon, EyeOffIcon, MailIcon } from "lucide-react";
|
import { EyeIcon, EyeOffIcon, MailIcon } from "lucide-react";
|
||||||
|
|
||||||
export function CredentialsSignUp() {
|
export type CredentialsSignUpFormValues = z.infer<typeof authSchema>;
|
||||||
const form = useForm<z.infer<typeof authSchema>>({
|
|
||||||
|
export function CredentialsSignUpForm() {
|
||||||
|
const form = useForm<CredentialsSignUpFormValues>({
|
||||||
resolver: zodResolver(authSchema),
|
resolver: zodResolver(authSchema),
|
||||||
defaultValues: {
|
defaultValues: {
|
||||||
email: "",
|
email: "",
|
||||||
@ -28,15 +30,15 @@ export function CredentialsSignUp() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
const [isVisible, setIsVisible] = useState<boolean>(false);
|
const [isVisible, setIsVisible] = useState<boolean>(false);
|
||||||
|
|
||||||
const toggleVisibility = () => setIsVisible((prevState) => !prevState);
|
const toggleVisibility = () => setIsVisible((prevState) => !prevState);
|
||||||
|
|
||||||
|
const onSubmit = async (data: CredentialsSignUpFormValues) => {
|
||||||
|
await signUpWithCredentials(data);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Form {...form}>
|
<Form {...form}>
|
||||||
<form
|
<form onSubmit={form.handleSubmit(onSubmit)} className="grid gap-6">
|
||||||
onSubmit={form.handleSubmit((data) => signUpWithCredentials(data))}
|
|
||||||
className="grid gap-6"
|
|
||||||
>
|
|
||||||
<FormField
|
<FormField
|
||||||
control={form.control}
|
control={form.control}
|
||||||
name="email"
|
name="email"
|
@ -1,7 +1,7 @@
|
|||||||
import { signIn } from "@/lib/auth";
|
import { signIn } from "@/lib/auth";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
export function GithubSignIn() {
|
export function GithubSignInForm() {
|
||||||
return (
|
return (
|
||||||
<form
|
<form
|
||||||
action={async () => {
|
action={async () => {
|
@ -1,5 +1,5 @@
|
|||||||
import { GithubSignIn } from "@/components/github-sign-in";
|
import { GithubSignInForm } from "@/components/github-sign-in-form";
|
||||||
import { CredentialsSignIn } from "@/components/credentials-sign-in";
|
import { CredentialsSignInForm } from "@/components/credentials-sign-in-form";
|
||||||
|
|
||||||
export function SignInForm() {
|
export function SignInForm() {
|
||||||
return (
|
return (
|
||||||
@ -10,13 +10,13 @@ export function SignInForm() {
|
|||||||
Enter your email below to sign in to your account
|
Enter your email below to sign in to your account
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<CredentialsSignIn />
|
<CredentialsSignInForm />
|
||||||
<div className="relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t after:border-border">
|
<div className="relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t after:border-border">
|
||||||
<span className="relative z-10 bg-background px-2 text-muted-foreground">
|
<span className="relative z-10 bg-background px-2 text-muted-foreground">
|
||||||
Or
|
Or
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<GithubSignIn />
|
<GithubSignInForm />
|
||||||
<div className="text-center text-sm">
|
<div className="text-center text-sm">
|
||||||
Don't have an account?{" "}
|
Don't have an account?{" "}
|
||||||
<a href="/sign-up" className="underline underline-offset-4">
|
<a href="/sign-up" className="underline underline-offset-4">
|
||||||
@ -24,5 +24,5 @@ export function SignInForm() {
|
|||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { GithubSignIn } from "@/components/github-sign-in";
|
import { GithubSignInForm } from "@/components/github-sign-in-form";
|
||||||
import { CredentialsSignUp } from "@/components/credentials-sign-up";
|
import { CredentialsSignUpForm } from "@/components/credentials-sign-up-form";
|
||||||
|
|
||||||
export function SignUpForm() {
|
export function SignUpForm() {
|
||||||
return (
|
return (
|
||||||
@ -10,19 +10,19 @@ export function SignUpForm() {
|
|||||||
Enter your email below to sign up to your account
|
Enter your email below to sign up to your account
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<CredentialsSignUp />
|
<CredentialsSignUpForm />
|
||||||
<div className="relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t after:border-border">
|
<div className="relative text-center text-sm after:absolute after:inset-0 after:top-1/2 after:z-0 after:flex after:items-center after:border-t after:border-border">
|
||||||
<span className="relative z-10 bg-background px-2 text-muted-foreground">
|
<span className="relative z-10 bg-background px-2 text-muted-foreground">
|
||||||
Or
|
Or
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<GithubSignIn />
|
<GithubSignInForm />
|
||||||
<div className="text-center text-sm">
|
<div className="text-center text-sm">
|
||||||
Already have an account? {" "}
|
Already have an account?{" "}
|
||||||
<a href="/sign-in" className="underline underline-offset-4">
|
<a href="/sign-in" className="underline underline-offset-4">
|
||||||
Sign in
|
Sign in
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user