1 | import React, {Component} from 'react';
|
2 | import PropTypes from 'prop-types';
|
3 | import classNames from 'classnames';
|
4 |
|
5 | import adaptiveIslandHOC from '../island/adaptive-island-hoc';
|
6 | import dataTests from '../global/data-tests';
|
7 |
|
8 | import styles from './island.css';
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | export default class Island extends Component {
|
15 | static propTypes = {
|
16 | children: PropTypes.node,
|
17 | className: PropTypes.string,
|
18 | narrow: PropTypes.bool,
|
19 | withoutPaddings: PropTypes.bool,
|
20 | 'data-test': PropTypes.string
|
21 | };
|
22 |
|
23 | render() {
|
24 |
|
25 | const {children, className, narrow, withoutPaddings, 'data-test': dataTest, ...restProps} = this.props;
|
26 | const classes = classNames(styles.island, className, {
|
27 | [styles.narrowIsland]: narrow,
|
28 | [styles.withoutPaddings]: withoutPaddings
|
29 | });
|
30 |
|
31 | return (
|
32 | <div
|
33 | {...restProps}
|
34 | className={classes}
|
35 | data-test={dataTests('ring-island', dataTest)}
|
36 | >
|
37 | {children}
|
38 | </div>
|
39 | );
|
40 | }
|
41 | }
|
42 |
|
43 | export const AdaptiveIsland = adaptiveIslandHOC(Island);
|
44 |
|
45 | export {default as Header} from './header';
|
46 | export {default as Content} from './content';
|