@zenkit/layout
Version:
ZenKit components for impliments layout
30 lines (27 loc) • 732 B
JavaScript
import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/objectWithoutPropertiesLoose";
import * as React from 'react';
import Box from './box';
function Container(_ref) {
let {
fluid,
gutter,
maxWidth,
children
} = _ref,
otherProps = _objectWithoutPropertiesLoose(_ref, ["fluid", "gutter", "maxWidth", "children"]);
if (!children) return;
return React.createElement(Box, _extends({
display: "block",
mx: "auto",
px: gutter,
width: "100%",
maxWidth: fluid ? '100%' : maxWidth
}, otherProps), children);
}
Container.defaultProps = {
fluid: false,
gutter: '2ch',
maxWidth: '960px'
};
export default Container;