1 line
1.3 KiB
JSON
1 line
1.3 KiB
JSON
{"ast":null,"code":"import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\nimport { mapToCssModules, tagPropType } from './utils';\nvar propTypes = {\n tag: tagPropType,\n fluid: PropTypes.oneOfType([PropTypes.bool, PropTypes.string]),\n className: PropTypes.string,\n cssModule: PropTypes.object\n};\nvar defaultProps = {\n tag: 'div'\n};\n\nvar Container = function Container(props) {\n var className = props.className,\n cssModule = props.cssModule,\n fluid = props.fluid,\n Tag = props.tag,\n attributes = _objectWithoutPropertiesLoose(props, [\"className\", \"cssModule\", \"fluid\", \"tag\"]);\n\n var containerClass = 'container';\n\n if (fluid === true) {\n containerClass = 'container-fluid';\n } else if (fluid) {\n containerClass = \"container-\" + fluid;\n }\n\n var classes = mapToCssModules(classNames(className, containerClass), cssModule);\n return React.createElement(Tag, _extends({}, attributes, {\n className: classes\n }));\n};\n\nContainer.propTypes = propTypes;\nContainer.defaultProps = defaultProps;\nexport default Container;","map":null,"metadata":{},"sourceType":"module"} |