bigbuffet-rw/app/soapbox/components/ui/banner/banner.tsx

28 lines
789 B
TypeScript
Raw Normal View History

2022-07-26 08:30:48 -07:00
import classNames from 'classnames';
import React from 'react';
interface IBanner {
theme: 'frosted' | 'opaque',
children: React.ReactNode,
2022-07-26 09:37:02 -07:00
className?: string,
2022-07-26 08:30:48 -07:00
}
/** Displays a sticky full-width banner at the bottom of the screen. */
2022-07-26 09:37:02 -07:00
const Banner: React.FC<IBanner> = ({ theme, children, className }) => {
2022-07-26 08:30:48 -07:00
return (
<div
data-testid='banner'
2022-07-26 11:22:13 -07:00
className={classNames('fixed bottom-0 left-0 right-0 py-8 z-50', {
'backdrop-blur bg-primary-800/80 dark:bg-primary-900/80': theme === 'frosted',
'bg-white dark:bg-gray-800 text-gray-900 dark:text-gray-100 shadow-3xl dark:shadow-inset': theme === 'opaque',
2022-07-26 09:37:02 -07:00
}, className)}
2022-07-26 08:30:48 -07:00
>
2022-07-26 11:22:13 -07:00
<div className='max-w-4xl mx-auto px-4'>
{children}
2022-07-26 08:30:48 -07:00
</div>
</div>
);
};
export default Banner;