Skip to content

Commit

Permalink
FIX: some bugs in Auth section
Browse files Browse the repository at this point in the history
Co-Authored-By: ruru <[email protected]>
  • Loading branch information
ruru-m07 and ruru-m07 committed Feb 24, 2024
1 parent e221d35 commit dd59a58
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 12 deletions.
17 changes: 15 additions & 2 deletions app/(auth)/loading.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,18 @@
import Loader from "@/components/Loader";
import Loader2 from "@/components/Loader2";
import { CardWrapper } from "@/components/auth/card-wrapper";

export default function Loading() {
return <Loader />;
return (
<>
<CardWrapper
headerLabel="Welcome back"
backButtonLabel=""
backButtonHref="/register"
>
<div className="w-full h-auto my-10 flex justify-center items-center">
<Loader2 />
</div>
</CardWrapper>
</>
);
}
2 changes: 1 addition & 1 deletion components/Loader2.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const Loader2 = ({ size }: { size?: number }) => {
return (
<div className="flex space-x-2 w-full fixed bg-card justify-center items-center">
<div className="flex space-x-2 w-full fixed bg-transparent justify-center items-center">
<div className=" flex justify-center items-center">
{size ? (
<svg
Expand Down
13 changes: 10 additions & 3 deletions components/auth/card-wrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,16 @@ export const CardWrapper = ({
</CardHeader>
<CardContent>{children}</CardContent>
{showSocial && (
<CardFooter>
<Social />
</CardFooter>
<>
<div className="flex items-center mt-4 mx-5 mb-4">
<div className="border-t border flex-grow"></div>
<div className="mx-4 text-muted-foreground">OR</div>
<div className="border-t border flex-grow"></div>
</div>
<CardFooter>
<Social />
</CardFooter>
</>
)}
<CardFooter>
<BackButton label={backButtonLabel} href={backButtonHref} />
Expand Down
6 changes: 3 additions & 3 deletions components/auth/login-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ export const LoginForm = () => {
headerLabel="Welcome back"
backButtonLabel="Don't have an account?"
backButtonHref="/register"
showSocial
// showSocial
>
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
Expand Down Expand Up @@ -189,11 +189,11 @@ export const LoginForm = () => {
<Button disabled={isPending} type="submit" className="w-full">
{showTwoFactor ? "Confirm" : "Login"}
</Button>
<div className="flex items-center mt-4 mb-4">
{/* <div className="flex items-center mt-4 mb-4">
<div className="border-t border flex-grow"></div>
<div className="mx-4 text-muted-foreground">OR</div>
<div className="border-t border flex-grow"></div>
</div>
</div> */}
</form>
</Form>
</CardWrapper>
Expand Down
6 changes: 3 additions & 3 deletions components/auth/register-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const RegisterForm = () => {
headerLabel="Create an account"
backButtonLabel="Already have an account?"
backButtonHref="/login"
showSocial
// showSocial
>
<Form {...form}>
<form onSubmit={form.handleSubmit(onSubmit)} className="space-y-6">
Expand Down Expand Up @@ -120,11 +120,11 @@ export const RegisterForm = () => {
<Button disabled={isPending} type="submit" className="w-full">
Create an account
</Button>
<div className="flex items-center mt-4 mb-4">
{/* <div className="flex items-center mt-4 mb-4">
<div className="border-t border flex-grow"></div>
<div className="mx-4 text-muted-foreground">OR</div>
<div className="border-t border flex-grow"></div>
</div>
</div> */}
</form>
</Form>
</CardWrapper>
Expand Down

0 comments on commit dd59a58

Please sign in to comment.