2023-02-06 10:01:03 -08:00
|
|
|
import clsx from 'clsx';
|
2022-07-26 08:30:48 -07:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
interface IBanner {
|
2023-02-15 13:26:27 -08:00
|
|
|
theme: 'frosted' | 'opaque'
|
|
|
|
children: React.ReactNode
|
|
|
|
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'
|
2023-02-06 10:06:44 -08:00
|
|
|
className={clsx('fixed inset-x-0 bottom-0 z-50 py-8', {
|
2022-07-22 10:30:16 -07: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 09:37:02 -07:00
|
|
|
}, className)}
|
2022-07-26 08:30:48 -07:00
|
|
|
>
|
2023-02-01 14:13:42 -08:00
|
|
|
<div className='mx-auto max-w-4xl px-4'>
|
2022-07-26 11:22:13 -07:00
|
|
|
{children}
|
2022-07-26 08:30:48 -07:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default Banner;
|