UNPKG

@selfcommunity/react-ui

Version:

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

44 lines (37 loc) 2.21 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 Event Header Skeleton component. Learn about the available props and the CSS API. #### Import ```jsx import {EventHeaderSkeleton} from '@selfcommunity/react-ui'; ``` #### Component Name The name `SCEventHeader-skeleton-root` can be used when providing style overrides in the theme. #### CSS |Rule Name|Global class|Description| |---|---|---| |root|.SCEventHeader-skeleton-root|Styles applied to the root element.| |avatar|.SCEventHeader-avatar|Styles applied to the avatar element.| |cover|.SCEventHeader-cover|Styles applied to the cover element.| |info|.SCEventHeader-info|Styles applied to the info info.| * */ function EventHeaderSkeleton() { 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: "rectangular", 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", mb: 1 }, { children: _jsx(Skeleton, { animation: "wave", variant: "rectangular", sx: { height: 20, width: '50%' } }) })), _jsx(Typography, Object.assign({ mb: 1 }, { children: _jsx(Skeleton, { animation: "wave", variant: "rectangular", sx: { height: 30, width: '30%' } }) })), _jsx(Typography, { children: _jsx(Skeleton, { animation: "wave", variant: "rectangular", sx: { height: 15, width: '20%' } }) })] }))] }))); } export default EventHeaderSkeleton;