Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: added SignIn, AuthNav and AuthFooter components #33

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
},
"dependencies": {
"@hookform/resolvers": "^4.1.3",
"@radix-ui/react-checkbox": "^1.1.4",
"@radix-ui/react-dialog": "^1.1.6",
"@radix-ui/react-label": "^2.1.2",
"@radix-ui/react-popover": "^1.1.6",
Expand Down
32 changes: 32 additions & 0 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions public/Logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions src/app/signin/components/AuthFooter.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

//import Image from "next/image";


//import Link from "next/link";

const AuthFooter = () => {
return ( <div className="w-full flex z-10 bg-[#F9FAFB] justify-center items-center px-3 py-4 border-b-[1px] border-[#E8E9E9] pt-10">


<div className="w-full flex items-center justify-center">
&copy; 2025 Adgen-AI. All rights reserved.
</div>



</div> );
}

export default AuthFooter;
20 changes: 20 additions & 0 deletions src/app/signin/components/AuthNav.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@

import Image from "next/image";


import Link from "next/link";

const AuthNav = () => {
return ( <div className="w-full flex bg-[#F9FAFB] justify-center items-center px-3 py-4 border-b-[1px] border-[#E8E9E9] ">

<Link href="/">
<div className="w-full cursor-pointer flex items-center justify-center">
<Image alt="Logo" src="Logo.svg" width={150} height={150}/>
</div>
</Link>


</div> );
}

export default AuthNav;
35 changes: 35 additions & 0 deletions src/app/signin/components/loading-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"use client"

import { type ButtonHTMLAttributes, forwardRef } from "react"
import { Loader2 } from "lucide-react"
import { Button } from "@/components/ui/button"
import { cn } from "@/lib/utils"

export interface LoadingButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
isLoading?: boolean
loadingText?: string
variant?: "default" | "destructive" | "outline" | "secondary" | "ghost" | "link"
size?: "default" | "sm" | "lg" | "icon"
}

const LoadingButton = forwardRef<HTMLButtonElement, LoadingButtonProps>(
({ className, children, isLoading, loadingText, variant = "default", size = "default", disabled, ...props }, ref) => {
return (
<Button
className={cn(className)}
disabled={disabled || isLoading}
variant={variant}
size={size}
ref={ref}
{...props}
>
{isLoading && <Loader2 className="mr-2 h-4 w-4 animate-spin" />}
{isLoading && loadingText ? loadingText : children}
</Button>
)
},
)
LoadingButton.displayName = "LoadingButton"

export { LoadingButton }

45 changes: 45 additions & 0 deletions src/app/signin/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@

import type { Metadata } from "next";
import { Inter } from "next/font/google";
import "../globals.css";
import AuthNav from "./components/AuthNav";
import AuthFooter from "./components/AuthFooter";


//import { useRouter } from "next/router";

const inter = Inter({ subsets: ["latin"] });

export const metadata: Metadata = {
title: "LIberty Electric",
description: "Get electrical services",
};

export default function DashboardLayout({
children,
}: Readonly<{
children: React.ReactNode;
}>) {

/* const router = useRouter()
const isDashboard = router.pathname.startsWith("/dashboard") */

return (

<html lang="en">
<body className={inter.className}>

<div className="flex flex-col min-h-screen ">
<AuthNav />
<main className="">{children}</main>

<AuthFooter />
</div>


</body>

</html>

);
}
31 changes: 31 additions & 0 deletions src/app/signin/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
"use client"

import {SignInForm} from "./sign-in-form";
//import { useRouter } from "next/navigation";
//import { useEffect } from "react";

const Login = () => {



//const router = useRouter();

/* useEffect(() => {
if (status === "authenticated") {
// Redirect to the dashboard if the user is authenticated
router.push("/dashboard");
}
}, [status, router]); */

/* if (status === "loading") {
return <div>Loading...</div>; // Optionally, add a loading state
} */

return (
<div className="pt-[30px] px-3 bg-[#F9FAFB]">
<SignInForm />
</div>
);
};

export default Login;
Loading