@navinc/base-react-components
Version:
Nav's Pattern Library
47 lines (45 loc) • 2.28 kB
JavaScript
;
var __rest = (this && this.__rest) || function (s, e) {
var t = {};
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
t[p] = s[p];
if (s != null && typeof Object.getOwnPropertySymbols === "function")
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
t[p[i]] = s[p[i]];
}
return t;
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const styled_components_1 = __importDefault(require("styled-components"));
const cdn_illustration_js_1 = __importDefault(require("./cdn-illustration.js"));
const loading_dots_js_1 = __importDefault(require("./loading-dots.js"));
const GoldenCenter = styled_components_1.default.div.withConfig({ displayName: "brc-sc-GoldenCenter", componentId: "brc-sc-zgl3am" }) `
display: flex;
align-items: center;
justify-content: center;
height: calc(100vh * 1 / ${({ theme }) => theme.goldenRatio});
`;
const LoadingContent = styled_components_1.default.div.withConfig({ displayName: "brc-sc-LoadingContent", componentId: "brc-sc-18zolej" }) `
display: flex;
flex-flow: column nowrap;
align-items: center;
& > ${loading_dots_js_1.default} {
color: ${({ theme }) => theme.navPrimary};
margin: 24px 0;
}
& > ${cdn_illustration_js_1.default} {
height: 190px;
}
`;
const LoadingView = (_a) => {
var { className, message = null, illustration } = _a, props = __rest(_a, ["className", "message", "illustration"]);
return ((0, jsx_runtime_1.jsx)(GoldenCenter, Object.assign({ className: className, "data-testid": "loading-view" }, props, { children: (0, jsx_runtime_1.jsxs)(LoadingContent, { children: [message, (0, jsx_runtime_1.jsx)(loading_dots_js_1.default, {}), illustration ? (0, jsx_runtime_1.jsx)(cdn_illustration_js_1.default, { filename: illustration }) : null] }) })));
};
LoadingView.displayName = 'LoadingView';
exports.default = LoadingView;
//# sourceMappingURL=loading-view.js.map