From c1ed758ad9ae60a47a5b0d92c278f6712366c6b7 Mon Sep 17 00:00:00 2001 From: Thomas Cristina de Carvalho Date: Thu, 1 Feb 2024 15:44:12 -0500 Subject: [PATCH] Add header blur and sticky settings --- app/components/layout/Header.tsx | 83 ++++++++++++++++++++++------ app/components/ui/NavigationMenu.tsx | 2 +- app/hooks/useBoundedScroll.tsx | 27 +++++++++ app/qroq/queries.ts | 4 +- studio/schemas/singletons/header.ts | 21 +++++++ 5 files changed, 119 insertions(+), 18 deletions(-) create mode 100644 app/hooks/useBoundedScroll.tsx diff --git a/app/components/layout/Header.tsx b/app/components/layout/Header.tsx index 87ef5aa..e4f7839 100644 --- a/app/components/layout/Header.tsx +++ b/app/components/layout/Header.tsx @@ -1,8 +1,11 @@ import type {CSSProperties} from 'react'; import {Link} from '@remix-run/react'; +import {vercelStegaCleanAll} from '@sanity/client/stega'; import {cx} from 'class-variance-authority'; +import {LazyMotion, m, useTransform} from 'framer-motion'; +import {useBoundedScroll} from '~/hooks/useBoundedScroll'; import {useLocalePath} from '~/hooks/useLocalePath'; import {useSanityRoot} from '~/hooks/useSanityRoot'; import {useSettingsCssVars} from '~/hooks/useSettingsCssVars'; @@ -13,31 +16,19 @@ import {CartCount} from './CartCount'; import {Logo} from './Logo'; export function Header() { - return ; -} - -function DesktopHeader() { const {data} = useSanityRoot(); const header = data?.header; const logoWidth = header?.desktopLogoWidth ? `${header?.desktopLogoWidth}px` : null; - const showSeparatorLine = header?.showSeparatorLine; + const homePath = useLocalePath({path: '/'}); const cssVars = useSettingsCssVars({ selector: 'header', settings: header, }); - const homePath = useLocalePath({path: '/'}); return ( -