UNPKG

@selfcommunity/react-ui

Version:

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

44 lines (37 loc) 2.1 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Box, Typography, useTheme } from '@mui/material'; import { styled } from '@mui/material/styles'; import Skeleton from '@mui/material/Skeleton'; import { PREFIX } from './constants'; const classes = { root: `${PREFIX}-skeleton-root`, cover: `${PREFIX}-cover`, avatar: `${PREFIX}-avatar`, info: `${PREFIX}-info` }; const Root = styled(Box, { name: PREFIX, slot: 'SkeletonRoot' })(() => ({})); /** * > API documentation for the Community-JS Group Header Skeleton component. Learn about the available props and the CSS API. #### Import ```jsx import {GroupHeaderSkeleton} from '@selfcommunity/react-ui'; ``` #### Component Name The name `SCGroupHeader-skeleton-root` can be used when providing style overrides in the theme. #### CSS |Rule Name|Global class|Description| |---|---|---| |root|.SCGroupHeader-skeleton-root|Styles applied to the root element.| |avatar|.SCGroupHeader-avatar|Styles applied to the avatar element.| |cover|.SCGroupHeader-cover|Styles applied to the cover element.| |info|.SCGroupHeader-info|Styles applied to the info info.| * */ function GroupHeaderSkeleton() { const theme = useTheme(); return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [_jsx(Skeleton, { className: classes.cover, animation: "wave", variant: "rectangular" }), _jsx(Box, Object.assign({ className: classes.avatar }, { children: _jsx(Skeleton, { animation: "wave", variant: "circular", width: theme.selfcommunity.group.avatar.sizeLarge, height: theme.selfcommunity.group.avatar.sizeLarge }) })), _jsxs(Box, Object.assign({ className: classes.info }, { children: [_jsx(Typography, Object.assign({ variant: "h5" }, { children: _jsx(Skeleton, { animation: "wave", sx: { height: 30, width: 200 } }) })), _jsx(Typography, { children: _jsx(Skeleton, { animation: "wave", sx: { height: 20, width: 150 } }) }), _jsx(Typography, { children: _jsx(Skeleton, { animation: "wave", sx: { height: 20, width: 100 } }) })] }))] }))); } export default GroupHeaderSkeleton;