GoScrobble/web/node_modules/react-bootstrap/esm/Container.js

28 lines
1.1 KiB
JavaScript
Raw Permalink Normal View History

2022-04-25 02:47:15 +00:00
import _extends from "@babel/runtime/helpers/esm/extends";
import _objectWithoutPropertiesLoose from "@babel/runtime/helpers/esm/objectWithoutPropertiesLoose";
var _excluded = ["bsPrefix", "fluid", "as", "className"];
import classNames from 'classnames';
import React from 'react';
import { useBootstrapPrefix } from './ThemeProvider';
var defaultProps = {
fluid: false
};
var Container = /*#__PURE__*/React.forwardRef(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, _excluded);
var prefix = useBootstrapPrefix(bsPrefix, 'container');
var suffix = typeof fluid === 'string' ? "-" + fluid : '-fluid';
return /*#__PURE__*/React.createElement(Component, _extends({
ref: ref
}, props, {
className: classNames(className, fluid ? "" + prefix + suffix : prefix)
}));
});
Container.displayName = 'Container';
Container.defaultProps = defaultProps;
export default Container;