split stuff up

This commit is contained in:
MapleLeaf
2021-12-29 17:12:42 -06:00
parent 401fcd2f16
commit eef9d3a0bc
5 changed files with 45 additions and 38 deletions

View File

@@ -0,0 +1,16 @@
import clsx from "clsx"
import { useScrolled } from "~/hooks/dom/use-scrolled"
export function Header({ children }: { children: React.ReactNode }) {
const isScrolled = useScrolled()
return (
<header
className={clsx(
isScrolled ? "bg-slate-700/30" : "bg-slate-800",
"shadow-md sticky top-0 px-4 py-3 backdrop-blur-sm transition",
)}
>
{children}
</header>
)
}