diff --git a/app/globals.css b/app/globals.css index 1e3cce5..b5c61c9 100644 --- a/app/globals.css +++ b/app/globals.css @@ -1,38 +1,3 @@ @tailwind base; @tailwind components; @tailwind utilities; - -:root { - --foreground-rgb: 0, 0, 0; - --background-start-rgb: 214, 219, 220; - --background-end-rgb: 255, 255, 255; -} - -@font-face { - font-family: "Popppins"; - src: url(); -} - -@media (prefers-color-scheme: dark) { - :root { - --foreground-rgb: 255, 255, 255; - --background-start-rgb: 0, 0, 0; - --background-end-rgb: 0, 0, 0; - } -} - -body { - color: rgb(var(--foreground-rgb)); - background: linear-gradient( - to bottom, - transparent, - rgb(var(--background-end-rgb)) - ) - rgb(var(--background-start-rgb)); -} - -@layer utilities { - .text-balance { - text-wrap: balance; - } -} diff --git a/app/layout.tsx b/app/layout.tsx index eced9c5..66ec492 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,6 +1,7 @@ import type { Metadata } from "next"; import { Inter, Poppins } from "next/font/google"; import "./globals.css"; +import dynamic from "next/dynamic"; // const inter = Inter({ subsets: ["latin"] }); @@ -15,14 +16,21 @@ export const metadata: Metadata = { description: "Generated by create next app", }; +const Navbar = dynamic(() => import("../components/NavigationBar")); + export default function RootLayout({ children, }: Readonly<{ children: React.ReactNode; }>) { + // if the current route is login or register, we don't want to show the nav bar + return ( - {children} + + + {children} + ); } diff --git a/app/login/page.tsx b/app/login/page.tsx index dce0001..c9aee06 100644 --- a/app/login/page.tsx +++ b/app/login/page.tsx @@ -1,9 +1,18 @@ +"use client"; import Image from "next/image"; +import { useRouter } from "next/navigation"; +import { FormEvent } from "react"; const Login = () => { + const router = useRouter(); + const handleLogin = (e: FormEvent) => { + e.preventDefault(); + router.push("/"); + }; + return (
-
+

Welcome to Feedback Flow

@@ -19,7 +28,10 @@ const Login = () => { OR
-
+ handleLogin(e)} + > { placeholder="********" /> {/* Find a darker color for hover */} -

Don't have an account?

-

Register

+ + Register +
diff --git a/app/page.tsx b/app/page.tsx index dc1acad..f78e945 100644 --- a/app/page.tsx +++ b/app/page.tsx @@ -1,114 +1,7 @@ -import Image from "next/image"; - export default function Home() { return ( -
-
-

- Get started by editing  - app/page.tsx -

-
- - By{" "} - Vercel Logo - - Login -
-
- -
- Next.js Logo -
- -
- -

- Docs{" "} - - -> - -

-

- Find in-depth information about Next.js features and API. -

-
- - -

- Learn{" "} - - -> - -

-

- Learn about Next.js in an interactive course with quizzes! -

-
- - -

- Templates{" "} - - -> - -

-

- Explore starter templates for Next.js. -

-
- - -

- Deploy{" "} - - -> - -

-

- Instantly deploy your Next.js site to a shareable URL with Vercel. -

-
-
+
+ Login
); } diff --git a/components/NavigationBar.jsx b/components/NavigationBar.jsx new file mode 100644 index 0000000..dd4ea5a --- /dev/null +++ b/components/NavigationBar.jsx @@ -0,0 +1,24 @@ +"use client"; +import { usePathname } from "next/navigation"; + +const NavigationBar = () => { + const pathname = usePathname(); + + // si estamos en el login o register no mostramos la navbar + if (pathname === "/login" || pathname === "/register") return null; + + return ( + + ); +}; +export default NavigationBar;