27 lines
1.1 KiB
JavaScript
27 lines
1.1 KiB
JavaScript
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
|
|
import classNames from 'classnames';
|
|
import React from 'react';
|
|
import { useBootstrapPrefix } from './ThemeProvider';
|
|
var defaultProps = {
|
|
fluid: false
|
|
};
|
|
var Container = React.forwardRef( // Need to define the default "as" during prop destructuring to be compatible with styled-components github.com/react-bootstrap/react-bootstrap/issues/3595
|
|
function (_ref, ref) {
|
|
var bsPrefix = _ref.bsPrefix,
|
|
fluid = _ref.fluid,
|
|
_ref$as = _ref.as,
|
|
Component = _ref$as === void 0 ? 'div' : _ref$as,
|
|
className = _ref.className,
|
|
props = _objectWithoutPropertiesLoose(_ref, ["bsPrefix", "fluid", "as", "className"]);
|
|
|
|
var prefix = useBootstrapPrefix(bsPrefix, 'container');
|
|
return React.createElement(Component, _extends({
|
|
ref: ref
|
|
}, props, {
|
|
className: classNames(className, fluid ? prefix + "-fluid" : prefix)
|
|
}));
|
|
});
|
|
Container.displayName = 'Container';
|
|
Container.defaultProps = defaultProps;
|
|
export default Container; |