@selfcommunity/react-ui
Version:
React UI Components to integrate a Community created with SelfCommunity Platform.
44 lines (37 loc) • 1.99 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import React from 'react';
import { styled } from '@mui/material/styles';
import { Grid, Hidden } from '@mui/material';
import { GenericSkeleton } from '../Skeleton';
import classNames from 'classnames';
import { PREFIX } from './constants';
const classes = {
root: `${PREFIX}-skeleton-root`,
left: `${PREFIX}-left`,
right: `${PREFIX}-right`
};
const Root = styled(Grid, {
name: PREFIX,
slot: 'SkeletonRoot'
})(() => ({}));
/**
* > API documentation for the Community-JS Feed Skeleton component. Learn about the available props and the CSS API.
#### Import
```jsx
import {FeedSkeleton} from '@selfcommunity/react-ui';
```
#### Component Name
The name `SCFeed-skeleton-root` can be used when providing style overrides in the theme.
#### CSS
|Rule Name|Global class|Description|
|---|---|---|
|root|.SCFeed-skeleton-root|Styles applied to the root element.|
|left|.SCFeed-left|Styles applied to the left section.|
|right|.SCFeed-right|Styles applied to the right section.|
*
*/
export default function FeedSkeleton(props) {
// PROPS
const { children = (_jsxs(React.Fragment, { children: [_jsx(GenericSkeleton, { sx: { mb: 2 } }), _jsx(GenericSkeleton, { sx: { mb: 2 } }), _jsx(GenericSkeleton, { sx: { mb: 2 } })] })), sidebar = (_jsxs(React.Fragment, { children: [_jsx(GenericSkeleton, { sx: { mb: 2 } }), _jsx(GenericSkeleton, { sx: { mb: 2 } })] })), className } = props;
return (_jsxs(Root, Object.assign({ container: true, spacing: 2, className: classNames(classes.root, className) }, { children: [_jsx(Grid, Object.assign({ item: true, xs: 12, md: 7 }, { children: _jsx("div", Object.assign({ className: classes.left }, { children: children })) })), _jsx(Hidden, Object.assign({ smDown: true }, { children: _jsx(Grid, Object.assign({ item: true, xs: 12, md: 5 }, { children: _jsx("div", Object.assign({ className: classes.right }, { children: sidebar })) })) }))] })));
}