2023-02-06 18:01:03 +00:00
|
|
|
import clsx from 'clsx';
|
2022-07-26 15:30:48 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
interface IBanner {
|
2023-02-15 21:26:27 +00:00
|
|
|
theme: 'frosted' | 'opaque'
|
|
|
|
children: React.ReactNode
|
|
|
|
className?: string
|
2022-07-26 15:30:48 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/** Displays a sticky full-width banner at the bottom of the screen. */
|
2022-07-26 16:37:02 +00:00
|
|
|
const Banner: React.FC<IBanner> = ({ theme, children, className }) => {
|
2022-07-26 15:30:48 +00:00
|
|
|
return (
|
|
|
|
<div
|
|
|
|
data-testid='banner'
|
2023-02-06 18:06:44 +00:00
|
|
|
className={clsx('fixed inset-x-0 bottom-0 z-50 py-8', {
|
2022-07-22 17:30:16 +00:00
|
|
|
'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 16:37:02 +00:00
|
|
|
}, className)}
|
2022-07-26 15:30:48 +00:00
|
|
|
>
|
2023-02-01 22:13:42 +00:00
|
|
|
<div className='mx-auto max-w-4xl px-4'>
|
2022-07-26 18:22:13 +00:00
|
|
|
{children}
|
2022-07-26 15:30:48 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Banner;
|