@selfcommunity/react-templates
Version:
React Templates Components to integrate a Community created with SelfCommunity.
51 lines (44 loc) • 4.01 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const jsx_runtime_1 = require("react/jsx-runtime");
const material_1 = require("@mui/material");
const PrizeItemSkeleton_1 = tslib_1.__importDefault(require("./PrizeItemSkeleton"));
const constants_1 = require("./constants");
const classes = {
root: `${constants_1.PREFIX}-skeleton-root`,
title: `${constants_1.PREFIX}-title`,
sectionTitle: `${constants_1.PREFIX}-section-title`,
subTitle: `${constants_1.PREFIX}-sub-title`,
pointsList: `${constants_1.PREFIX}-points-list`,
chip: `${constants_1.PREFIX}-chip`
};
const Root = (0, material_1.styled)(material_1.Box, {
name: constants_1.PREFIX,
slot: 'SkeletonRoot'
})(() => ({}));
/**
* > API documentation for the Community-JS Loyalty Program Detail Skeleton component. Learn about the available props and the CSS API.
#### Import
```jsx
import {LoyaltyProgramDetailSkeleton} from '@selfcommunity/react-templates';
```
#### Component Name
The name `SCLoyaltyProgramDetailTemplate-skeleton-root` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCLoyaltyProgramDetailTemplate-skeleton-root|Styles applied to the root element.|
|title|.SCLoyaltyProgramDetailTemplate-title|Styles applied to the title element.|
|sectionTitle|.SCLoyaltyProgramDetailTemplate-section-title|Styles applied to the section title element.|
|subTitle|.SCLoyaltyProgramDetailTemplate-subTitle|Styles applied to the subTitle element.|
|pointsList|.SCLoyaltyProgramDetailTemplate-points-list|Styles applied to the points list section.|
|chip|.SCLoyaltyProgramDetailTemplate-chip|Styles applied to the chip element.|
*
*/
function LoyaltyProgramDetailSkeleton() {
const theme = (0, material_1.useTheme)();
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.title, component: 'div' }, { children: [!isMobile && (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 30, width: 140, variant: "text" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "circular", width: 172, height: 30, className: classes.chip })] })), (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.sectionTitle }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 20, width: '50%', variant: "text" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 17, width: '80%', variant: "text", className: classes.subTitle })] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.sectionTitle }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 20, width: 146 }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: 2, className: classes.pointsList }, { children: [...Array(8)].map((prize, index) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 15, width: "100%" }) }), index))) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.sectionTitle }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 20, width: 140, variant: "text" }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: isMobile ? 3 : 6 }, { children: [...Array(6)].map((prize, index) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 4 }, { children: (0, jsx_runtime_1.jsx)(PrizeItemSkeleton_1.default, {}) }), index))) }))] })));
}
exports.default = LoyaltyProgramDetailSkeleton;