UNPKG

@selfcommunity/react-ui

Version:

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

47 lines (40 loc) 2.44 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const tslib_1 = require("tslib"); const jsx_runtime_1 = require("react/jsx-runtime"); const styles_1 = require("@mui/material/styles"); const material_1 = require("@mui/material"); const Skeleton_1 = tslib_1.__importDefault(require("@mui/material/Skeleton")); const NotificationItem_1 = tslib_1.__importDefault(require("../../shared/NotificationItem")); const notification_1 = require("../../types/notification"); const constants_1 = require("./constants"); const classes = { root: `${constants_1.PREFIX}-skeleton-root`, list: `${constants_1.PREFIX}-list`, item: `${constants_1.PREFIX}-item` }; const Root = (0, styles_1.styled)(material_1.List, { name: constants_1.PREFIX, slot: 'SkeletonRoot' })(() => ({})); /** * > API documentation for the Community-JS Snippet Notification Skeleton component. Learn about the available props and the CSS API. #### Import ```jsx import {SnippetNotificationsSkeleton} from '@selfcommunity/react-ui'; ``` #### Component Name The name `SCSnippetNotification-skeleton-root` can be used when providing style overrides in the theme. #### CSS |Rule Name|Global class|Description| |---|---|---| |root|.SCSnippetNotification-skeleton-root|Styles applied to the root element.| |item|.SCSnippetNotification-item|Styles applied to the item element.| * */ function SnippetNotificationSkeleton(props) { const theme = (0, material_1.useTheme)(); const notificationSkeleton = ((0, jsx_runtime_1.jsx)(NotificationItem_1.default, { className: classes.item, template: notification_1.SCNotificationObjectTemplateType.SNIPPET, image: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", variant: "circular", width: theme.selfcommunity.user.avatar.sizeSmall, height: theme.selfcommunity.user.avatar.sizeSmall }), primary: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 120, style: { marginBottom: 10 } }), secondary: (0, jsx_runtime_1.jsx)(Skeleton_1.default, { animation: "wave", height: 10, width: 70, style: { marginBottom: 10 } }) })); return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root }, props, { children: [...Array(7)].map((x, i) => ((0, jsx_runtime_1.jsx)(material_1.ListItem, Object.assign({ className: classes.item }, { children: notificationSkeleton }), i))) }))); } exports.default = SnippetNotificationSkeleton;