import { siteConfig } from "@client/configs" import { openInFollowApp } from "@client/lib/helper" import { Logo } from "@follow/components/icons/logo.jsx" import { Button } from "@follow/components/ui/button/index.jsx" import { Kbd } from "@follow/components/ui/kbd/Kbd.jsx" import { cn } from "@follow/utils/utils" import type { MotionValue } from "framer-motion" import { useMotionValueEvent, useScroll } from "framer-motion" import * as React from "react" import { useState } from "react" import { useHotkeys } from "react-hotkeys-hook" import { Link } from "react-router-dom" const useMotionValueToState = (value: MotionValue) => { const [state, setState] = useState(value.get()) useMotionValueEvent(value, "change", (v) => setState(v)) return state } function Container({ className, ...props }: React.ComponentPropsWithoutRef<"div">) { return (
) } const HeaderWrapper: Component = (props) => { const { scrollY } = useScroll() const scrollYState = useMotionValueToState(scrollY) const showOverlay = scrollYState > 100 return (
{props.children}
) } export const Header = () => { const handleToApp = () => { openInFollowApp( "", () => { window.open(siteConfig.appUrl, "_blank") }, true, ) } useHotkeys("l", handleToApp) return ( ) }