mirror of
https://github.com/StanGirard/quivr.git
synced 2024-12-19 17:01:41 +03:00
7e88032dc9
## Relates to Epic: #1232 Issue: #1377 ## 🚩 Feature flag Use in growthbook the flag: `new-homepage-activated` (boolean) ## 📷 Screenshots ### 🖥️ Desktop <img width="1059" alt="image" src="https://github.com/StanGirard/quivr/assets/67386567/e0bae17a-bb94-4ba8-8dc3-a79d18f5d933"> ### 📱 Mobile <img width="377" alt="image" src="https://github.com/StanGirard/quivr/assets/67386567/af8398dc-d9df-4034-a329-49aae3b2bf45"> <img width="375" alt="image" src="https://github.com/StanGirard/quivr/assets/67386567/c5d53051-939e-49df-9c0a-212eff576b34"> --------- Co-authored-by: Zineb El Bachiri <100568984+gozineb@users.noreply.github.com>
48 lines
1.2 KiB
TypeScript
48 lines
1.2 KiB
TypeScript
"use client";
|
|
import { useFeatureIsOn } from "@growthbook/growthbook-react";
|
|
import { useEffect } from "react";
|
|
|
|
import { useSupabase } from "@/lib/context/SupabaseProvider";
|
|
import { redirectToPreviousPageOrChatPage } from "@/lib/helpers/redirectToPreviousPageOrChatPage";
|
|
|
|
import Features from "./Features";
|
|
import Hero from "./Hero";
|
|
import { HomeHeader } from "./components";
|
|
|
|
const HomePage = (): JSX.Element => {
|
|
const { session } = useSupabase();
|
|
|
|
useEffect(() => {
|
|
if (session?.user !== undefined) {
|
|
redirectToPreviousPageOrChatPage();
|
|
}
|
|
}, [session?.user]);
|
|
|
|
const isNewHomePage = useFeatureIsOn("new-homepage-activated");
|
|
|
|
if (isNewHomePage) {
|
|
return (
|
|
<>
|
|
<div data-testid="home-page">
|
|
<div className="fixed bg-gradient-to-b from-[#6300FF] to-[#D07DF9] w-screen h-[50vh] z-[-1]"></div>
|
|
<HomeHeader />
|
|
<main>
|
|
<div className="mx-auto my-5 p-5 w-min-content bg-yellow-100 rounded-lg">
|
|
🚧 New homepage in progress 🚧
|
|
</div>
|
|
</main>
|
|
</div>
|
|
</>
|
|
);
|
|
} else {
|
|
return (
|
|
<main data-testid="home-page">
|
|
<Hero />
|
|
<Features />
|
|
</main>
|
|
);
|
|
}
|
|
};
|
|
|
|
export default HomePage;
|