File size: 1,898 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
import { ListTile, Gridicon } from '@automattic/components';
import Banner from 'calypso/components/banner';
const icons = [ 'custom-post-type', 'cloud', 'layout' ];

const BannerExample = () => (
	<div>
		<Banner disableHref title="A simple banner" />
		<Banner
			callToAction="Update"
			description="This is the description."
			disableHref
			showIcon
			title="Simple banner with description and call to action"
		/>
		<Banner
			callToAction="Update"
			disableHref
			showIcon={ false }
			title="Simple banner with custom list items"
			list={ icons }
			renderListItem={ ( icon ) => (
				<ListTile
					title={ <h5>Feature name</h5> }
					leading={
						<div
							style={ {
								display: 'flex',
								marginRight: '10px',
								alignItems: 'center',
								borderRadius: '50%',
								justifyContent: 'center',
								flexShrink: 0,
								width: '24px',
								height: '24px',
								padding: '3px 4px 4px 3px',
								backgroundColor: 'var(--color-accent)',
							} }
						>
							<Gridicon
								icon={ icon }
								size={ 18 }
								style={ { marginRight: '0px', color: 'var(--color-text-inverted)' } }
							/>
						</div>
					}
					trailing={
						<div style={ { marginLeft: '8px' } }>
							<Gridicon
								color="#C6C6C6"
								icon="info-outline"
								size={ 18 }
								style={ { verticalAlign: 'unset' } }
							/>
						</div>
					}
				/>
			) }
		/>
		<Banner showIcon={ false } title="Banner with showIcon set to false" />
		<Banner
			callToAction="Backup"
			description="New plugins can lead to unexpected changes. Ensure you can restore your site if something goes wrong."
			dismissPreferenceName="devdocs-banner-backups-example"
			dismissTemporary
			horizontal
			href="#"
			jetpack
			title="A Jetpack banner with a call to action"
		/>
	</div>
);

BannerExample.displayName = 'Banner';

export default BannerExample;