-
- {/* Desktop navigation */}
-
-
-
+
+
+
@@ -86,27 +93,22 @@ function HeaderAnimation(props: {
children: React.ReactNode;
className: string;
}) {
- // See Animated Sticky Header from Build UI (https://buildui.com/recipes/fixed-header)
const loadFeatures = async () =>
await import('../../lib/framerMotionFeatures').then((res) => res.default);
- const {scrollYBoundedProgress} = useBoundedScroll(400);
- const scrollYBoundedProgressDelayed = useTransform(
- scrollYBoundedProgress,
- [0, 0.75, 1],
- [0, 0, 1],
- );
-
- const style = {
- transform: useTransform(
- scrollYBoundedProgressDelayed,
- [0, 1],
- ['translateY(0)', 'translateY(-100%)'],
- ),
- };
+ const {direction} = useScrollDirection();
return (
-
+
{props.children}
diff --git a/app/components/navigation/Navigation.tsx b/app/components/navigation/DesktopNavigation.tsx
similarity index 94%
rename from app/components/navigation/Navigation.tsx
rename to app/components/navigation/DesktopNavigation.tsx
index be78059..a6e6582 100644
--- a/app/components/navigation/Navigation.tsx
+++ b/app/components/navigation/DesktopNavigation.tsx
@@ -15,9 +15,9 @@ import {
import {NestedNavigation} from './NestedNavigation';
type HeaderQuery = InferType
;
-type NavigationProps = NonNullable['menu'];
+export type NavigationProps = NonNullable['menu'];
-export function Navigation(props: {data?: NavigationProps}) {
+export function DesktopNavigation(props: {data?: NavigationProps}) {
const menuRef = useRef(null);
const [activeItem, setActiveItem] = useState(null);
const dropdownWidth = 200;
@@ -28,7 +28,7 @@ export function Navigation(props: {data?: NavigationProps}) {
);
return (
-