-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBanner.tsx
More file actions
49 lines (45 loc) · 1.4 KB
/
Banner.tsx
File metadata and controls
49 lines (45 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import { Divider } from '@mantine/core';
import { BiConfused } from 'react-icons/bi';
import { overlay } from '../constants/default';
/**
* Banner component
* @usage
- use `className` a string that allows for the addition of custom classes to the banner wrapper
- use `title` a string that sets the banner title
- use `subtitle` a string that sets the banner subtitle
- use `icon` a React component that sets the banner icon
*/
function Banner(props: BannerProps) {
return (
<div
className={`banner rounded-xl py-20 px-12 overflow-hidden relative mb-8 z-10 leading-4 ${props.className}`}
style={{
backgroundImage: `url('${overlay}'), linear-gradient(to right, #20c997, #57e6b0fa) `,
backgroundSize: 'cover',
backgroundRepeat: 'no-repeat',
}}
>
<div className='flex items-center text-white'>
<div className='text-6xl relative '>
<props.icon className='inline-block' />
</div>
<Divider
className='mx-8 border-white'
size='md'
orientation='vertical'
/>
<div className='flex-1'>
<h3 className='text-3xl font-bold mb-2 mt-0'>{props.title}</h3>
<span className='inline-block'>{props.subtitle}</span>
</div>
</div>
</div>
);
}
Banner.defaultProps = {
title: 'Title',
subtitle: 'Subtitle',
className: '',
icon: BiConfused,
};
export default Banner;