diff --git a/src/components/Popup.tsx b/src/components/Popup.tsx index 83f3f045..d91ef2b0 100644 --- a/src/components/Popup.tsx +++ b/src/components/Popup.tsx @@ -23,52 +23,53 @@ const Popup: React.FC = () => { aria-live="assertive" className="pointer-events-none fixed inset-0 z-10 flex items-end px-4 py-6 sm:items-end sm:p-6" > - -
-
-
-
-
-
-

- {popupHeader} -

-

- {popupMessage} -

-
-
- +
+
+

+ {popupHeader} +

+

+ {popupMessage} +

+
+
+ +
- -
+ + ); }; diff --git a/src/views/home/components/Header.tsx b/src/views/home/components/Header.tsx new file mode 100644 index 00000000..a4e8c70a --- /dev/null +++ b/src/views/home/components/Header.tsx @@ -0,0 +1,72 @@ +import { useState, useEffect } from "react"; +import Link from "next/link"; +import Button from "~/components/Button"; +import { twMerge } from "tailwind-merge"; + +const Header = ({ isLoggedIn }: { isLoggedIn: boolean }) => { + const [isScrolled, setIsScrolled] = useState(false); + + useEffect(() => { + const handleScroll = () => { + setIsScrolled(window.scrollY > 0); + }; + window.addEventListener("scroll", handleScroll); + return () => window.removeEventListener("scroll", handleScroll); + }, []); + + return ( + <> +
+
+
+
+

+ kan.bn +

+
+
+ + Roadmap + + + Features + + + Pricing + + + Docs + +
+
+ {isLoggedIn ? ( + + ) : ( + <> + + + + )} +
+
+
+
+ {isScrolled &&
} + + ); +}; + +export default Header; diff --git a/src/views/home/index.tsx b/src/views/home/index.tsx index 9a7a12d6..fffd5791 100644 --- a/src/views/home/index.tsx +++ b/src/views/home/index.tsx @@ -6,7 +6,9 @@ import { IoLogoGithub } from "react-icons/io"; import Button from "~/components/Button"; import PatternedBackground from "~/components/PatternedBackground"; +import Header from "./components/Header"; import Pricing from "./components/Pricing"; + import { api } from "~/utils/api"; import { env } from "~/env.mjs"; @@ -38,40 +40,7 @@ export default function HomeView() {
-
-
-

- kan.bn -

-
-
- - Roadmap - - - Features - - - Pricing - - - Docs - -
-
- {isLoggedIn ? ( - - ) : ( - <> - - - - )} -
-
- +