@wulperstudio/cms
Version:
Wulper Studio Library Components CMS
66 lines (65 loc) • 2.94 kB
JavaScript
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.BottomBar = void 0;
var _react = _interopRequireDefault(require("react"));
var _uuid = require("uuid");
var _material = require("@mui/material");
var _styled = require("./styled");
var _jsxRuntime = require("react/jsx-runtime");
var BottomBar = exports.BottomBar = function BottomBar(props) {
var theme = (0, _material.useTheme)();
var _props$variant = props.variant,
variant = _props$variant === void 0 ? 'float' : _props$variant,
_props$isTextEnabled = props.isTextEnabled,
isTextEnabled = _props$isTextEnabled === void 0 ? false : _props$isTextEnabled,
options = props.options,
_props$borderVariant = props.borderVariant,
borderVariant = _props$borderVariant === void 0 ? 'middle' : _props$borderVariant,
isDivider = props.isDivider,
_props$indexFloat = props.indexFloat,
indexFloat = _props$indexFloat === void 0 ? 3 : _props$indexFloat,
_props$activeColor = props.activeColor,
activeColor = _props$activeColor === void 0 ? theme.palette.primary.main : _props$activeColor,
_props$floatIconColor = props.floatIconColor,
floatIconColor = _props$floatIconColor === void 0 ? theme.palette.primary.main : _props$floatIconColor,
_props$backgroundColo = props.backgroundColor,
backgroundColor = _props$backgroundColo === void 0 ? theme.palette.background["default"] : _props$backgroundColo,
_props$foregroundColo = props.foregroundColor,
foregroundColor = _props$foregroundColo === void 0 ? theme.palette.background.paper : _props$foregroundColo;
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.WrapperBottomBar, {
backgroundColor: backgroundColor,
isDivider: isDivider,
children: options.map(function (_ref, i) {
var icon = _ref.icon,
text = _ref.text,
toRoute = _ref.toRoute,
active = _ref.active;
if (i + 1 === indexFloat && variant === 'float') {
return /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.WrapperCenterButton, {
borderVariant: borderVariant,
foregroundColor: foregroundColor,
children: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styled.CenterButton, {
onClick: toRoute,
floatIconColor: floatIconColor,
children: [icon, isTextEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.Text, {
children: text
})]
})
}, (0, _uuid.v4)());
}
return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_styled.WrapperOption, {
activeColor: activeColor,
isTextEnabled: isTextEnabled,
onClick: toRoute,
active: active,
children: [icon, isTextEnabled && /*#__PURE__*/(0, _jsxRuntime.jsx)(_styled.Text, {
active: active,
children: text
})]
}, (0, _uuid.v4)());
})
});
};