From 41dd75a24d48bc18ac36d1d131c3887bf7a15696 Mon Sep 17 00:00:00 2001 From: Abhishek Hegde Date: Fri, 24 Nov 2023 00:19:46 +0530 Subject: [PATCH] Navbar , sign in , sign out , home page. automatic redirect if user was signed in . nested layout inside notes route to have navbar visible at alll times inside rout. --- src/app/layout.tsx | 6 +- src/app/notes/NavBar.tsx | 32 ++++++++++ src/app/notes/layout.tsx | 10 +++ src/app/page.tsx | 129 +++++++-------------------------------- 4 files changed, 68 insertions(+), 109 deletions(-) create mode 100644 src/app/notes/NavBar.tsx create mode 100644 src/app/notes/layout.tsx diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 5c017bb..bbc7aac 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,13 +1,13 @@ +import { ClerkProvider } from "@clerk/nextjs"; import type { Metadata } from "next"; import { Inter } from "next/font/google"; import "./globals.css"; -import { ClerkProvider } from "@clerk/nextjs"; const inter = Inter({ subsets: ["latin"] }); export const metadata: Metadata = { - title: "Ai-Note-Taking-App", - description: "Intelligent note taking app", + title: "FlowBrain", + description: "The intelligent note-taking app", }; export default function RootLayout({ diff --git a/src/app/notes/NavBar.tsx b/src/app/notes/NavBar.tsx new file mode 100644 index 0000000..e03843f --- /dev/null +++ b/src/app/notes/NavBar.tsx @@ -0,0 +1,32 @@ +import logo from "@/assets/logo.png"; +import { Button } from "@/components/ui/button"; +import { UserButton } from "@clerk/nextjs"; +import { Plus } from "lucide-react"; +import Image from "next/image"; +import Link from "next/link"; + +export default function NavBar() { + return ( +
+
+ + FlowBrain logo + FlowBrain + +
+ + +
+
+
+ ); +} + diff --git a/src/app/notes/layout.tsx b/src/app/notes/layout.tsx new file mode 100644 index 0000000..a96fe2e --- /dev/null +++ b/src/app/notes/layout.tsx @@ -0,0 +1,10 @@ +import NavBar from "./NavBar"; + +export default function Layout({ children }: { children: React.ReactNode }) { + return ( + <> + +
{children}
+ + ); +} diff --git a/src/app/page.tsx b/src/app/page.tsx index e38c626..211b187 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,113 +1,30 @@ -import Image from 'next/image' +import logo from "@/assets/logo.png"; +import { Button } from "@/components/ui/button"; +import { auth } from "@clerk/nextjs"; +import Image from "next/image"; +import Link from "next/link"; +import { redirect } from "next/navigation"; export default function Home() { - return ( -
-
-

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

-
- - By{' '} - Vercel Logo - -
-
- -
- Next.js Logo -
+ const { userId } = auth(); -
- -

- Docs{' '} - - -> - -

-

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

-
+ if (userId) redirect("/notes"); - -

- Learn{' '} - - -> - -

-

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

-
- - -

- Templates{' '} - - -> - -

-

- Explore the Next.js 13 playground. -

-
- - -

- Deploy{' '} - - -> - -

-

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

-
+ return ( +
+
+ FlowBrain logo + + FlowBrain +
+

+ An intelligent note-taking app with AI integration, built with OpenAI, + Pinecone, Next.js, Shadcn UI, Clerk, and more. +

+
- ) + ); }