diff --git a/public/_static/dark-dashboard-preview.jpg b/public/_static/dark-dashboard-preview.jpg new file mode 100644 index 00000000..64253bb7 Binary files /dev/null and b/public/_static/dark-dashboard-preview.jpg differ diff --git a/public/_static/light-dashboard-preview.jpg b/public/_static/light-dashboard-preview.jpg new file mode 100644 index 00000000..cab831a1 Binary files /dev/null and b/public/_static/light-dashboard-preview.jpg differ diff --git a/src/app/(marketing)/_components/home-preview.tsx b/src/app/(marketing)/_components/home-preview.tsx new file mode 100644 index 00000000..4c1f61c7 --- /dev/null +++ b/src/app/(marketing)/_components/home-preview.tsx @@ -0,0 +1,44 @@ +'use client'; + +import { useEffect, useState } from 'react'; +import { useTheme } from 'next-themes'; +import Image from 'next/image'; + +/** + * This component renders the dashboard preview image that is used on the home + * marketing page, it will use the light or dark image depending on the theme. + * + * @returns A react component representing the dashboard preview image. + */ +export function HomePreview() { + const [mounted, setMounted] = useState(false); + const { resolvedTheme } = useTheme(); + + useEffect(() => { + setMounted(true); + }, []); + + if (mounted && resolvedTheme === 'light') { + return ( + <> + Dashboard Preview + + ); + } + + return ( + Dashboard Preview + ); +} diff --git a/src/app/(marketing)/_components/navbar.tsx b/src/app/(marketing)/_components/navbar.tsx index 7c766477..16cf991e 100644 --- a/src/app/(marketing)/_components/navbar.tsx +++ b/src/app/(marketing)/_components/navbar.tsx @@ -1,6 +1,6 @@ 'use client'; -import * as React from 'react'; +import { forwardRef, useEffect, useState } from 'react'; import Image from 'next/image'; import Link from 'next/link'; @@ -10,9 +10,6 @@ import { Edit2Icon, FlaskRoundIcon, ListChecksIcon, - PaintbrushIcon, - RssIcon, - User2Icon, } from 'lucide-react'; import { constants } from '@/constants'; @@ -64,28 +61,7 @@ const features: ListItemProps[] = [ }, ]; -const companyItems: ListItemProps[] = [ - { - title: 'About Us', - icon: , - href: '/docs/primitives/alert-dialog', - description: 'Learn more about the team behind Noodle.', - }, - { - title: 'Blog', - icon: , - href: '/docs/primitives/progress', - description: 'Read about the latest updates and features of Noodle.', - }, - { - title: 'Design System', - icon: , - href: '/docs/primitives/progress', - description: 'Learn about the design system we use to build Noodle.', - }, -]; - -const ListItem = React.forwardRef< +const ListItem = forwardRef< React.ElementRef<'a'>, React.ComponentPropsWithoutRef<'a'> & { icon: React.ReactNode } >(({ className, title, children, icon, ...props }, ref) => { @@ -115,8 +91,30 @@ const ListItem = React.forwardRef< ListItem.displayName = 'ListItem'; export const Navbar = () => { + const [scroll, setScroll] = useState(false); + + useEffect(() => { + const handleScroll = () => { + if (window.scrollY > 50) { + setScroll(true); + } else { + setScroll(false); + } + }; + + window.addEventListener('scroll', handleScroll); + return () => { + window.removeEventListener('scroll', handleScroll); + }; + }, []); + return ( -