0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-03-11 02:12:21 -05:00

Experimenting with sticky footers in AdminX

refs. https://github.com/TryGhost/Team/issues/3354
This commit is contained in:
Peter Zimon 2023-06-09 14:29:39 +02:00
parent 4e5523674c
commit 2d3ab08724

View file

@ -0,0 +1,49 @@
import React from 'react';
import clsx from 'clsx';
interface StickyFooterProps {
shiftY?: string;
children?: React.ReactNode;
}
const BlurryStickyFooter: React.FC<StickyFooterProps> = ({
shiftY,
children
}) => {
const containerClasses = clsx(
'w-100 sticky z-[9997] m-0 box-border p-0',
'backdrop-blur',
'bg-[rgba(255,255,255,0.4)]'
);
const containerBottom = shiftY ? `calc(${shiftY})` : '0';
const containerHeight = `82px`;
const contentClasses = clsx(
`sticky z-[9999] flex items-center justify-between`,
'h-[96px]'
);
const contentBottom = '0';
const contentHeight = `82px`;
return (
<>
<div className={containerClasses}
style={{
bottom: containerBottom,
height: containerHeight
}}
>
<div className={contentClasses}
style={{
bottom: contentBottom,
height: contentHeight
}}
>
{children}
</div>
</div>
</>
);
};
export default BlurryStickyFooter;