@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
45 lines (38 loc) • 2 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { styled } from '@mui/material/styles';
import { Grid, useMediaQuery, useTheme } from '@mui/material';
import PrivateMessageSnippetsSkeleton from '../PrivateMessageSnippets/Skeleton';
import PrivateMessageThreadSkeleton from '../PrivateMessageThread/Skeleton';
import classNames from 'classnames';
import { PREFIX } from './constants';
const classes = {
root: `${PREFIX}-skeleton-root`,
snippetsSection: `${PREFIX}-snippets-section`,
threadSection: `${PREFIX}-thread-section`
};
const Root = styled(Grid, {
name: 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|
*
*/
export default function PrivateMessageComponentSkeleton(props) {
const { className } = props;
const theme = useTheme();
const isMobile = useMediaQuery(theme.breakpoints.down('md'));
return (_jsxs(Root, Object.assign({ container: true, className: classNames(classes.root, className) }, { children: [!isMobile && (_jsx(Grid, Object.assign({ item: true, xs: 12, md: 5, className: classes.snippetsSection }, { children: _jsx(PrivateMessageSnippetsSkeleton, {}) }))), _jsx(Grid, Object.assign({ item: true, xs: 12, md: 7, className: classes.threadSection }, { children: _jsx(PrivateMessageThreadSkeleton, {}) }))] })));
}