This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
2017-04-28 05:18:46 +00:00
|
|
|
// @flow
|
2016-05-07 18:52:08 +00:00
|
|
|
import React from 'react';
|
|
|
|
import styles from './CenteredContent.scss';
|
|
|
|
|
2017-04-28 05:18:46 +00:00
|
|
|
type Props = {
|
|
|
|
children: any,
|
|
|
|
style: Object,
|
2017-05-10 06:14:24 +00:00
|
|
|
maxWidth: string,
|
2017-04-28 05:18:46 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
const CenteredContent = (props: Props) => {
|
2016-05-07 18:52:08 +00:00
|
|
|
const style = {
|
|
|
|
maxWidth: props.maxWidth,
|
|
|
|
...props.style,
|
|
|
|
};
|
|
|
|
|
|
|
|
return (
|
2017-04-28 04:48:13 +00:00
|
|
|
<div className={styles.content} style={style}>
|
|
|
|
{props.children}
|
2016-05-07 18:52:08 +00:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
CenteredContent.defaultProps = {
|
2016-05-23 05:08:09 +00:00
|
|
|
maxWidth: '740px',
|
2016-05-07 18:52:08 +00:00
|
|
|
};
|
|
|
|
|
2017-04-28 04:48:13 +00:00
|
|
|
export default CenteredContent;
|