UNPKG

@selfcommunity/react-ui

Version:

React UI Components to integrate a Community created with SelfCommunity Platform.

45 lines (38 loc) 2.56 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = tslib_1.__importDefault(require("react")); const CardContent_1 = tslib_1.__importDefault(require("@mui/material/CardContent")); const styles_1 = require("@mui/material/styles"); const material_1 = require("@mui/material"); const Skeleton_1 = tslib_1.__importDefault(require("@mui/material/Skeleton")); const Widget_1 = tslib_1.__importDefault(require("../Widget")); const constants_1 = require("./constants"); const classes = { root: `${constants_1.PREFIX}-skeleton-root` }; const Root = (0, styles_1.styled)(Widget_1.default, { name: constants_1.PREFIX, slot: 'SkeletonRoot' })(() => ({})); /** * > API documentation for the Community-JS Notification Skeleton component. Learn about the available props and the CSS API. #### Import ```jsx import {NotificationSkeleton} from '@selfcommunity/react-ui'; ``` #### Component Name The name `SCNotification-skeleton-root` can be used when providing style overrides in the theme. #### CSS |Rule Name|Global class|Description| |---|---|---| |root|.SCNotification-skeleton-root|Styles applied to the root element.| * */ function NotificationSkeleton(props) { const theme = (0, material_1.useTheme)(); const notification = ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsx)(material_1.CardHeader, { avatar: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: theme.selfcommunity.user.avatar.sizeMedium, height: theme.selfcommunity.user.avatar.sizeMedium }), title: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: "80%", style: { marginBottom: 6 } }), subheader: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: "40%" }) }) })); return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, props, { children: [(0, jsx_runtime_1.jsxs)(CardContent_1.default, Object.assign({ sx: { paddingBottom: 1 } }, { children: [(0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 20, style: { marginBottom: 0 } }), (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 15, width: "60%", style: { marginBottom: 0 } })] })), [...Array(Math.floor(Math.random() * 5) + 1)].map((x, i) => ((0, jsx_runtime_1.jsx)(react_1.default.Fragment, { children: notification }, i)))] }))); } exports.default = NotificationSkeleton;