UNPKG

@selfcommunity/react-ui

Version:

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

49 lines (42 loc) 2.4 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("../PrivateMessageSnippets/Skeleton")); const Skeleton_2 = tslib_1.__importDefault(require("../PrivateMessageThread/Skeleton")); const classnames_1 = tslib_1.__importDefault(require("classnames")); const constants_1 = require("./constants"); const classes = { root: `${constants_1.PREFIX}-skeleton-root`, snippetsSection: `${constants_1.PREFIX}-snippets-section`, threadSection: `${constants_1.PREFIX}-thread-section` }; const Root = (0, styles_1.styled)(material_1.Grid, { name: constants_1.PREFIX, slot: 'SkeletonRoot' })(() => ({})); /** * > API documentation for the Community-JS Private Messages Skeleton Template. Learn about the available props and the CSS API. #### Import ```jsx import {PrivateMessageComponentSkeleton} from '@selfcommunity/react-templates'; ``` #### Component Name The name `SCPrivateMessageComponentSkeleton` can be used when providing style overrides in the theme. #### CSS |Rule Name|Global class|Description| |---|---|---| |root|.SCPrivateMessageComponent-skeleton-root|Styles applied to the root element.| |snippetsSection|.SCPrivateMessageComponent-snippets-section|Styles applied to the snippets section| |threadSection|.SCPrivateMessageComponent-thread-section|Styles applied to the thread section| * */ function PrivateMessageComponentSkeleton(props) { const { className } = props; 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({ container: true, className: (0, classnames_1.default)(classes.root, className) }, { children: [!isMobile && ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 5, className: classes.snippetsSection }, { children: (0, jsx_runtime_1.jsx)(Skeleton_1.default, {}) }))), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, md: 7, className: classes.threadSection }, { children: (0, jsx_runtime_1.jsx)(Skeleton_2.default, {}) }))] }))); } exports.default = PrivateMessageComponentSkeleton;