File size: 1,007 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
import { JETPACK_PRODUCTS_LIST, JETPACK_PLANS } from '@automattic/calypso-products';
import { Component } from 'react';
import SitesDropdown from 'calypso/components/sites-dropdown';
import ProductPlanOverlapNotices from '../';

class ProductPlanOverlapNoticesExample extends Component {
	state = {
		siteId: 0,
	};

	render() {
		return (
			<div style={ { maxWidth: 520, margin: '0 auto' } }>
				<div style={ { maxWidth: 300, margin: '0 auto 10px' } }>
					<SitesDropdown onSiteSelect={ ( siteId ) => this.setState( { siteId } ) } />
				</div>

				{ this.state.siteId ? (
					<ProductPlanOverlapNotices
						plans={ JETPACK_PLANS }
						products={ JETPACK_PRODUCTS_LIST }
						siteId={ this.state.siteId }
					/>
				) : (
					<p style={ { textAlign: 'center' } }>
						Please, select a Jetpack site to experience the full demo.
					</p>
				) }
			</div>
		);
	}
}

ProductPlanOverlapNoticesExample.displayName = 'ProductPlanOverlapNotices';

export default ProductPlanOverlapNoticesExample;