From d8015b8b55559056432b8f016d891a6011f80e6d Mon Sep 17 00:00:00 2001 From: Prince Baghel Date: Mon, 23 Sep 2024 17:54:38 +0530 Subject: [PATCH] update: homepage (auth and non-auth) --- src/app/page.tsx | 160 +++++++++++++++++++++++++++++++---------------- 1 file changed, 107 insertions(+), 53 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index d92756c..c8f67e7 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -44,27 +44,37 @@ const footerAnimationStates = { }; export default function Home() { + const { isSignedIn, orgId, orgSlug, userId } = useAuth(); + + return isSignedIn ? ( + + ) : ( + + ); +} + +const AuthenticatedHome = ({ + isSignedIn, + orgId, + orgSlug, + userId, +}: { + isSignedIn: boolean; + orgId: string; + orgSlug: string; + userId: string; +}) => { const [input, setInput] = useState(""); - const router = useRouter(); - const controls = useAnimation(); - const [ref, inView] = useInView(); - useEffect(() => { - if (inView) { - controls.start("visible"); - } else { - controls.start("hidden"); - } - }, [controls, inView]); const [chatType, setChattype] = useQueryState( "model", parseAsString.withDefault("chat"), ); - - const { isSignedIn, orgId, orgSlug, userId } = useAuth(); - // if (isSignedIn) { - // redirect("/dashboard/user"); - // } - + const router = useRouter(); const handleInputChange = (e: any) => { setInput(e.target.value); navigator.clipboard.writeText(e.target.value); @@ -88,6 +98,79 @@ export default function Home() { } }; + return ( +
+
+
+ +
+
+ image of echoes being used +
+ +
+
+

+ Hello Innovator, +

+

+ Let's hyper-accelerate your research. +

+
+
+ > + } + /> +
+ +
+
+
+
+
+ +
+
+
+
+ ); +}; + +const UnAuthenticatedHome = ({ isSignedIn }: { isSignedIn: boolean }) => { + const controls = useAnimation(); + const [ref, inView] = useInView(); + useEffect(() => { + if (inView) { + controls.start("visible"); + } else { + controls.start("hidden"); + } + }, [controls, inView]); return (
@@ -117,42 +200,13 @@ export default function Home() { Let's hyper-accelerate your research.
- {isSignedIn && orgId && orgSlug ? ( -
- > - } - /> -
- -
- -
-
-
- ) : ( - - - Dashboard - - )} + + + Dashboard + {isSignedIn || (
); -} +};