2023-06-20 16:52:00 -05:00
|
|
|
// Hooks
|
|
|
|
import { useContext } from 'react'
|
|
|
|
import { LoadingContext } from 'shared/context/loading-context.mjs'
|
|
|
|
import { Ribbon } from 'shared/components/ribbon.mjs'
|
|
|
|
|
2023-06-21 12:29:19 +02:00
|
|
|
export const HeaderWrapper = ({ show, children }) => {
|
2023-06-20 16:52:00 -05:00
|
|
|
const { loading } = useContext(LoadingContext)
|
|
|
|
return (
|
|
|
|
<header
|
|
|
|
className={`
|
|
|
|
fixed bottom-0 lg:bottom-auto lg:top-0 left-0
|
|
|
|
bg-neutral
|
|
|
|
w-full
|
|
|
|
z-30
|
|
|
|
transition-transform
|
|
|
|
duration-300 ease-in-out
|
2023-06-23 14:29:09 -05:00
|
|
|
${show || loading ? '' : 'translate-y-36 lg:-translate-y-36'}
|
2023-06-20 16:52:00 -05:00
|
|
|
drop-shadow-xl
|
|
|
|
`}
|
|
|
|
>
|
|
|
|
{' '}
|
|
|
|
{children}
|
|
|
|
<Ribbon />
|
|
|
|
</header>
|
|
|
|
)
|
|
|
|
}
|
2023-06-23 14:29:09 -05:00
|
|
|
|
|
|
|
export const shownHeaderSelector = 'group-[.header-shown]/layout:'
|