@selfcommunity/react-ui 0.7.9-alpha.1 → 0.7.9-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/components/BottomNavigation/BottomNavigation.js +3 -1
- package/lib/cjs/components/ChangeGroupCover/ChangeGroupCover.d.ts +55 -0
- package/lib/cjs/components/ChangeGroupCover/ChangeGroupCover.js +117 -0
- package/lib/cjs/components/ChangeGroupCover/constants.d.ts +1 -0
- package/lib/cjs/components/ChangeGroupCover/constants.js +4 -0
- package/lib/cjs/components/ChangeGroupCover/index.d.ts +3 -0
- package/lib/cjs/components/ChangeGroupCover/index.js +5 -0
- package/lib/cjs/components/ChangeGroupPicture/ChangeGroupPicture.d.ts +57 -0
- package/lib/cjs/components/ChangeGroupPicture/ChangeGroupPicture.js +117 -0
- package/lib/cjs/components/ChangeGroupPicture/constants.d.ts +1 -0
- package/lib/cjs/components/ChangeGroupPicture/constants.js +4 -0
- package/lib/cjs/components/ChangeGroupPicture/index.d.ts +3 -0
- package/lib/cjs/components/ChangeGroupPicture/index.js +5 -0
- package/lib/cjs/components/CreateGroup/CreateGroup.d.ts +48 -0
- package/lib/cjs/components/CreateGroup/CreateGroup.js +187 -0
- package/lib/cjs/components/CreateGroup/constants.d.ts +1 -0
- package/lib/cjs/components/CreateGroup/constants.js +4 -0
- package/lib/cjs/components/CreateGroup/index.d.ts +3 -0
- package/lib/cjs/components/CreateGroup/index.js +5 -0
- package/lib/cjs/components/CreateGroupButton/CreateGroupButton.d.ts +38 -0
- package/lib/cjs/components/CreateGroupButton/CreateGroupButton.js +73 -0
- package/lib/cjs/components/CreateGroupButton/index.d.ts +3 -0
- package/lib/cjs/components/CreateGroupButton/index.js +5 -0
- package/lib/cjs/components/Group/Group.d.ts +67 -0
- package/lib/cjs/components/Group/Group.js +96 -0
- package/lib/cjs/components/Group/Skeleton.d.ts +22 -0
- package/lib/cjs/components/Group/Skeleton.js +42 -0
- package/lib/cjs/components/Group/constants.d.ts +1 -0
- package/lib/cjs/components/Group/constants.js +4 -0
- package/lib/cjs/components/Group/index.d.ts +4 -0
- package/lib/cjs/components/Group/index.js +8 -0
- package/lib/cjs/components/GroupHeader/GroupHeader.d.ts +83 -0
- package/lib/cjs/components/GroupHeader/GroupHeader.js +137 -0
- package/lib/cjs/components/GroupHeader/Skeleton.d.ts +27 -0
- package/lib/cjs/components/GroupHeader/Skeleton.js +56 -0
- package/lib/cjs/components/GroupHeader/constants.d.ts +1 -0
- package/lib/cjs/components/GroupHeader/constants.js +4 -0
- package/lib/cjs/components/GroupHeader/index.d.ts +4 -0
- package/lib/cjs/components/GroupHeader/index.js +8 -0
- package/lib/cjs/components/GroupInfoWidget/GroupInfoWidget.d.ts +52 -0
- package/lib/cjs/components/GroupInfoWidget/GroupInfoWidget.js +100 -0
- package/lib/cjs/components/GroupInfoWidget/Skeleton.d.ts +21 -0
- package/lib/cjs/components/GroupInfoWidget/Skeleton.js +38 -0
- package/lib/cjs/components/GroupInfoWidget/constants.d.ts +1 -0
- package/lib/cjs/components/GroupInfoWidget/constants.js +4 -0
- package/lib/cjs/components/GroupInfoWidget/index.d.ts +4 -0
- package/lib/cjs/components/GroupInfoWidget/index.js +8 -0
- package/lib/cjs/components/GroupInviteButton/GroupInviteButton.d.ts +57 -0
- package/lib/cjs/components/GroupInviteButton/GroupInviteButton.js +261 -0
- package/lib/cjs/components/GroupInviteButton/index.d.ts +3 -0
- package/lib/cjs/components/GroupInviteButton/index.js +5 -0
- package/lib/cjs/components/GroupMembersButton/GroupMembersButton.d.ts +46 -0
- package/lib/cjs/components/GroupMembersButton/GroupMembersButton.js +135 -0
- package/lib/cjs/components/GroupMembersButton/index.d.ts +3 -0
- package/lib/cjs/components/GroupMembersButton/index.js +5 -0
- package/lib/cjs/components/GroupMembersWidget/GroupMembersWidget.d.ts +79 -0
- package/lib/cjs/components/GroupMembersWidget/GroupMembersWidget.js +197 -0
- package/lib/cjs/components/GroupMembersWidget/Skeleton.d.ts +22 -0
- package/lib/cjs/components/GroupMembersWidget/Skeleton.js +38 -0
- package/lib/cjs/components/GroupMembersWidget/constants.d.ts +1 -0
- package/lib/cjs/components/GroupMembersWidget/constants.js +4 -0
- package/lib/cjs/components/GroupMembersWidget/index.d.ts +4 -0
- package/lib/cjs/components/GroupMembersWidget/index.js +8 -0
- package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +79 -0
- package/lib/cjs/components/GroupRequestsWidget/GroupRequestsWidget.js +194 -0
- package/lib/cjs/components/GroupRequestsWidget/Skeleton.d.ts +22 -0
- package/lib/cjs/components/GroupRequestsWidget/Skeleton.js +38 -0
- package/lib/cjs/components/GroupRequestsWidget/constants.d.ts +1 -0
- package/lib/cjs/components/GroupRequestsWidget/constants.js +4 -0
- package/lib/cjs/components/GroupRequestsWidget/index.d.ts +4 -0
- package/lib/cjs/components/GroupRequestsWidget/index.js +8 -0
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +51 -0
- package/lib/cjs/components/GroupSubscribeButton/GroupSubscribeButton.js +117 -0
- package/lib/cjs/components/GroupSubscribeButton/index.d.ts +3 -0
- package/lib/cjs/components/GroupSubscribeButton/index.js +5 -0
- package/lib/cjs/components/Groups/Groups.d.ts +65 -0
- package/lib/cjs/components/Groups/Groups.js +184 -0
- package/lib/cjs/components/Groups/Skeleton.d.ts +22 -0
- package/lib/cjs/components/Groups/Skeleton.js +38 -0
- package/lib/cjs/components/Groups/constants.d.ts +1 -0
- package/lib/cjs/components/Groups/constants.js +4 -0
- package/lib/cjs/components/Groups/index.d.ts +4 -0
- package/lib/cjs/components/Groups/index.js +8 -0
- package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.d.ts +4 -0
- package/lib/cjs/components/InlineComposerWidget/InlineComposerWidget.js +2 -3
- package/lib/cjs/components/NavigationToolbar/NavigationToolbar.js +5 -1
- package/lib/cjs/components/User/User.d.ts +12 -0
- package/lib/cjs/components/User/User.js +5 -3
- package/lib/cjs/constants/Group.d.ts +2 -0
- package/lib/cjs/constants/Group.js +5 -0
- package/lib/cjs/index.d.ts +14 -1
- package/lib/cjs/index.js +34 -2
- package/lib/esm/components/BottomNavigation/BottomNavigation.js +3 -1
- package/lib/esm/components/ChangeGroupCover/ChangeGroupCover.d.ts +55 -0
- package/lib/esm/components/ChangeGroupCover/ChangeGroupCover.js +114 -0
- package/lib/esm/components/ChangeGroupCover/constants.d.ts +1 -0
- package/lib/esm/components/ChangeGroupCover/constants.js +1 -0
- package/lib/esm/components/ChangeGroupCover/index.d.ts +3 -0
- package/lib/esm/components/ChangeGroupCover/index.js +2 -0
- package/lib/esm/components/ChangeGroupPicture/ChangeGroupPicture.d.ts +57 -0
- package/lib/esm/components/ChangeGroupPicture/ChangeGroupPicture.js +114 -0
- package/lib/esm/components/ChangeGroupPicture/constants.d.ts +1 -0
- package/lib/esm/components/ChangeGroupPicture/constants.js +1 -0
- package/lib/esm/components/ChangeGroupPicture/index.d.ts +3 -0
- package/lib/esm/components/ChangeGroupPicture/index.js +2 -0
- package/lib/esm/components/CreateGroup/CreateGroup.d.ts +48 -0
- package/lib/esm/components/CreateGroup/CreateGroup.js +184 -0
- package/lib/esm/components/CreateGroup/constants.d.ts +1 -0
- package/lib/esm/components/CreateGroup/constants.js +1 -0
- package/lib/esm/components/CreateGroup/index.d.ts +3 -0
- package/lib/esm/components/CreateGroup/index.js +2 -0
- package/lib/esm/components/CreateGroupButton/CreateGroupButton.d.ts +38 -0
- package/lib/esm/components/CreateGroupButton/CreateGroupButton.js +70 -0
- package/lib/esm/components/CreateGroupButton/index.d.ts +3 -0
- package/lib/esm/components/CreateGroupButton/index.js +2 -0
- package/lib/esm/components/Group/Group.d.ts +67 -0
- package/lib/esm/components/Group/Group.js +93 -0
- package/lib/esm/components/Group/Skeleton.d.ts +22 -0
- package/lib/esm/components/Group/Skeleton.js +38 -0
- package/lib/esm/components/Group/constants.d.ts +1 -0
- package/lib/esm/components/Group/constants.js +1 -0
- package/lib/esm/components/Group/index.d.ts +4 -0
- package/lib/esm/components/Group/index.js +4 -0
- package/lib/esm/components/GroupHeader/GroupHeader.d.ts +83 -0
- package/lib/esm/components/GroupHeader/GroupHeader.js +134 -0
- package/lib/esm/components/GroupHeader/Skeleton.d.ts +27 -0
- package/lib/esm/components/GroupHeader/Skeleton.js +53 -0
- package/lib/esm/components/GroupHeader/constants.d.ts +1 -0
- package/lib/esm/components/GroupHeader/constants.js +1 -0
- package/lib/esm/components/GroupHeader/index.d.ts +4 -0
- package/lib/esm/components/GroupHeader/index.js +4 -0
- package/lib/esm/components/GroupInfoWidget/GroupInfoWidget.d.ts +52 -0
- package/lib/esm/components/GroupInfoWidget/GroupInfoWidget.js +97 -0
- package/lib/esm/components/GroupInfoWidget/Skeleton.d.ts +21 -0
- package/lib/esm/components/GroupInfoWidget/Skeleton.js +34 -0
- package/lib/esm/components/GroupInfoWidget/constants.d.ts +1 -0
- package/lib/esm/components/GroupInfoWidget/constants.js +1 -0
- package/lib/esm/components/GroupInfoWidget/index.d.ts +4 -0
- package/lib/esm/components/GroupInfoWidget/index.js +4 -0
- package/lib/esm/components/GroupInviteButton/GroupInviteButton.d.ts +57 -0
- package/lib/esm/components/GroupInviteButton/GroupInviteButton.js +258 -0
- package/lib/esm/components/GroupInviteButton/index.d.ts +3 -0
- package/lib/esm/components/GroupInviteButton/index.js +2 -0
- package/lib/esm/components/GroupMembersButton/GroupMembersButton.d.ts +46 -0
- package/lib/esm/components/GroupMembersButton/GroupMembersButton.js +132 -0
- package/lib/esm/components/GroupMembersButton/index.d.ts +3 -0
- package/lib/esm/components/GroupMembersButton/index.js +2 -0
- package/lib/esm/components/GroupMembersWidget/GroupMembersWidget.d.ts +79 -0
- package/lib/esm/components/GroupMembersWidget/GroupMembersWidget.js +194 -0
- package/lib/esm/components/GroupMembersWidget/Skeleton.d.ts +22 -0
- package/lib/esm/components/GroupMembersWidget/Skeleton.js +34 -0
- package/lib/esm/components/GroupMembersWidget/constants.d.ts +1 -0
- package/lib/esm/components/GroupMembersWidget/constants.js +1 -0
- package/lib/esm/components/GroupMembersWidget/index.d.ts +4 -0
- package/lib/esm/components/GroupMembersWidget/index.js +4 -0
- package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.d.ts +79 -0
- package/lib/esm/components/GroupRequestsWidget/GroupRequestsWidget.js +191 -0
- package/lib/esm/components/GroupRequestsWidget/Skeleton.d.ts +22 -0
- package/lib/esm/components/GroupRequestsWidget/Skeleton.js +34 -0
- package/lib/esm/components/GroupRequestsWidget/constants.d.ts +1 -0
- package/lib/esm/components/GroupRequestsWidget/constants.js +1 -0
- package/lib/esm/components/GroupRequestsWidget/index.d.ts +4 -0
- package/lib/esm/components/GroupRequestsWidget/index.js +4 -0
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.d.ts +51 -0
- package/lib/esm/components/GroupSubscribeButton/GroupSubscribeButton.js +114 -0
- package/lib/esm/components/GroupSubscribeButton/index.d.ts +3 -0
- package/lib/esm/components/GroupSubscribeButton/index.js +2 -0
- package/lib/esm/components/Groups/Groups.d.ts +65 -0
- package/lib/esm/components/Groups/Groups.js +181 -0
- package/lib/esm/components/Groups/Skeleton.d.ts +22 -0
- package/lib/esm/components/Groups/Skeleton.js +34 -0
- package/lib/esm/components/Groups/constants.d.ts +1 -0
- package/lib/esm/components/Groups/constants.js +1 -0
- package/lib/esm/components/Groups/index.d.ts +4 -0
- package/lib/esm/components/Groups/index.js +4 -0
- package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.d.ts +4 -0
- package/lib/esm/components/InlineComposerWidget/InlineComposerWidget.js +3 -4
- package/lib/esm/components/NavigationToolbar/NavigationToolbar.js +5 -1
- package/lib/esm/components/User/User.d.ts +12 -0
- package/lib/esm/components/User/User.js +5 -3
- package/lib/esm/constants/Group.d.ts +2 -0
- package/lib/esm/constants/Group.js +2 -0
- package/lib/esm/index.d.ts +14 -1
- package/lib/esm/index.js +14 -1
- package/lib/umd/react-ui.js +1 -1
- package/package.json +6 -6
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { ButtonProps } from '@mui/material/Button/Button';
|
|
2
|
+
import { CreateGroupProps } from '../CreateGroup';
|
|
3
|
+
export interface CreateGroupButtonProps extends ButtonProps {
|
|
4
|
+
/**
|
|
5
|
+
* Overrides or extends the styles applied to the component.
|
|
6
|
+
* @default null
|
|
7
|
+
*/
|
|
8
|
+
className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Props to spread to CreateGroup component
|
|
11
|
+
* @default empty object
|
|
12
|
+
*/
|
|
13
|
+
CreateGroupProps?: CreateGroupProps;
|
|
14
|
+
/**
|
|
15
|
+
* Any other properties
|
|
16
|
+
*/
|
|
17
|
+
[p: string]: any;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
*> API documentation for the Community-JS Create Group Button component. Learn about the available props and the CSS API.
|
|
21
|
+
*
|
|
22
|
+
#### Import
|
|
23
|
+
```jsx
|
|
24
|
+
import {CreateGroupButton} from '@selfcommunity/react-ui';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
#### Component Name
|
|
28
|
+
The name `SCCreateGroupButton` can be used when providing style overrides in the theme.
|
|
29
|
+
|
|
30
|
+
#### CSS
|
|
31
|
+
|
|
32
|
+
|Rule Name|Global class|Description|
|
|
33
|
+
|---|---|---|
|
|
34
|
+
|root|.SCCreateGroupButton-root|Styles applied to the root element.|
|
|
35
|
+
|
|
36
|
+
* @param inProps
|
|
37
|
+
*/
|
|
38
|
+
export default function CreateGroupButton(inProps: CreateGroupButtonProps): JSX.Element;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const system_1 = require("@mui/system");
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const react_intl_1 = require("react-intl");
|
|
9
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
10
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
11
|
+
const CreateGroup_1 = tslib_1.__importDefault(require("../CreateGroup"));
|
|
12
|
+
const PREFIX = 'SCCreateGroupButton';
|
|
13
|
+
const classes = {
|
|
14
|
+
root: `${PREFIX}-root`
|
|
15
|
+
};
|
|
16
|
+
const Root = (0, styles_1.styled)(material_1.Button, {
|
|
17
|
+
name: PREFIX,
|
|
18
|
+
slot: 'Root',
|
|
19
|
+
overridesResolver: (props, styles) => styles.root
|
|
20
|
+
})(({ theme }) => ({}));
|
|
21
|
+
/**
|
|
22
|
+
*> API documentation for the Community-JS Create Group Button component. Learn about the available props and the CSS API.
|
|
23
|
+
*
|
|
24
|
+
#### Import
|
|
25
|
+
```jsx
|
|
26
|
+
import {CreateGroupButton} from '@selfcommunity/react-ui';
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
#### Component Name
|
|
30
|
+
The name `SCCreateGroupButton` can be used when providing style overrides in the theme.
|
|
31
|
+
|
|
32
|
+
#### CSS
|
|
33
|
+
|
|
34
|
+
|Rule Name|Global class|Description|
|
|
35
|
+
|---|---|---|
|
|
36
|
+
|root|.SCCreateGroupButton-root|Styles applied to the root element.|
|
|
37
|
+
|
|
38
|
+
* @param inProps
|
|
39
|
+
*/
|
|
40
|
+
function CreateGroupButton(inProps) {
|
|
41
|
+
//PROPS
|
|
42
|
+
const props = (0, system_1.useThemeProps)({
|
|
43
|
+
props: inProps,
|
|
44
|
+
name: PREFIX
|
|
45
|
+
});
|
|
46
|
+
const { className, CreateGroupProps = {} } = props, rest = tslib_1.__rest(props, ["className", "CreateGroupProps"]);
|
|
47
|
+
// CONTEXT
|
|
48
|
+
const scUserContext = (0, react_1.useContext)(react_core_1.SCUserContext);
|
|
49
|
+
// STATE
|
|
50
|
+
const [open, setOpen] = react_1.default.useState(false);
|
|
51
|
+
// CONST
|
|
52
|
+
const authUserId = scUserContext.user ? scUserContext.user.id : null;
|
|
53
|
+
/**
|
|
54
|
+
* Handle click on button
|
|
55
|
+
*/
|
|
56
|
+
const handleClick = () => {
|
|
57
|
+
setOpen((p) => !p);
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* If there's no authUserId, component is hidden.
|
|
61
|
+
*/
|
|
62
|
+
if (!authUserId) {
|
|
63
|
+
return null;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Renders root object
|
|
67
|
+
*/
|
|
68
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
69
|
+
react_1.default.createElement(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), onClick: handleClick, size: "small", variant: "contained", startIcon: react_1.default.createElement(material_1.Icon, { fontSize: "small" }, "add") }, rest),
|
|
70
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.createGroupButton", defaultMessage: "ui.createGroupButton" })),
|
|
71
|
+
open && react_1.default.createElement(CreateGroup_1.default, Object.assign({}, CreateGroupProps, { open: true, onClose: handleClick }))));
|
|
72
|
+
}
|
|
73
|
+
exports.default = CreateGroupButton;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { ButtonBaseProps } from '@mui/material';
|
|
2
|
+
import { SCGroupType } from '@selfcommunity/types';
|
|
3
|
+
import { WidgetProps } from '../Widget';
|
|
4
|
+
export interface GroupProps extends WidgetProps {
|
|
5
|
+
/**
|
|
6
|
+
* Group Object
|
|
7
|
+
* @default null
|
|
8
|
+
*/
|
|
9
|
+
group?: SCGroupType;
|
|
10
|
+
/**
|
|
11
|
+
* Id of the group for filter the feed
|
|
12
|
+
* @default null
|
|
13
|
+
*/
|
|
14
|
+
groupId?: number;
|
|
15
|
+
/**
|
|
16
|
+
* Handles actions ignore
|
|
17
|
+
* @default null
|
|
18
|
+
*/
|
|
19
|
+
handleIgnoreAction?: (u: any) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Badge content to show as group avatar badge if show reaction is true.
|
|
22
|
+
*/
|
|
23
|
+
badgeContent?: any;
|
|
24
|
+
/**
|
|
25
|
+
* Prop to hide actions
|
|
26
|
+
* @default false
|
|
27
|
+
*/
|
|
28
|
+
hideActions?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Props to spread to the button
|
|
31
|
+
* @default {}
|
|
32
|
+
*/
|
|
33
|
+
buttonProps?: ButtonBaseProps;
|
|
34
|
+
/**
|
|
35
|
+
* Any other properties
|
|
36
|
+
*/
|
|
37
|
+
[p: string]: any;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* > API documentation for the Community-JS Group component. Learn about the available props and the CSS API.
|
|
41
|
+
*
|
|
42
|
+
*
|
|
43
|
+
* This component renders a group item.
|
|
44
|
+
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/User)
|
|
45
|
+
|
|
46
|
+
#### Import
|
|
47
|
+
|
|
48
|
+
```jsx
|
|
49
|
+
import {group} from '@selfcommunity/react-ui';
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
#### Component Name
|
|
53
|
+
|
|
54
|
+
The name `SCGroup` can be used when providing style overrides in the theme.
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
#### CSS
|
|
58
|
+
|
|
59
|
+
|Rule Name|Global class|Description|
|
|
60
|
+
|---|---|---|
|
|
61
|
+
|root|.SCGroup-root|Styles applied to the root element.|
|
|
62
|
+
|avatar|.SCGroup-avatar|Styles applied to the avatar element.|
|
|
63
|
+
|
|
64
|
+
*
|
|
65
|
+
* @param inProps
|
|
66
|
+
*/
|
|
67
|
+
export default function Group(inProps: GroupProps): JSX.Element;
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
8
|
+
const react_intl_1 = require("react-intl");
|
|
9
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
10
|
+
const system_1 = require("@mui/system");
|
|
11
|
+
const BaseItemButton_1 = tslib_1.__importDefault(require("../../shared/BaseItemButton"));
|
|
12
|
+
const UserDeletedSnackBar_1 = tslib_1.__importDefault(require("../../shared/UserDeletedSnackBar"));
|
|
13
|
+
const constants_1 = require("./constants");
|
|
14
|
+
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
15
|
+
const GroupSubscribeButton_1 = tslib_1.__importDefault(require("../GroupSubscribeButton"));
|
|
16
|
+
const messages = (0, react_intl_1.defineMessages)({
|
|
17
|
+
groupMembers: {
|
|
18
|
+
id: 'ui.group.members',
|
|
19
|
+
defaultMessage: 'ui.group.members'
|
|
20
|
+
}
|
|
21
|
+
});
|
|
22
|
+
const classes = {
|
|
23
|
+
root: `${constants_1.PREFIX}-root`,
|
|
24
|
+
avatar: `${constants_1.PREFIX}-avatar`,
|
|
25
|
+
actions: `${constants_1.PREFIX}-actions`
|
|
26
|
+
};
|
|
27
|
+
const Root = (0, styles_1.styled)(BaseItemButton_1.default, {
|
|
28
|
+
name: constants_1.PREFIX,
|
|
29
|
+
slot: 'Root',
|
|
30
|
+
overridesResolver: (props, styles) => styles.root
|
|
31
|
+
})(({ theme }) => ({}));
|
|
32
|
+
/**
|
|
33
|
+
* > API documentation for the Community-JS Group component. Learn about the available props and the CSS API.
|
|
34
|
+
*
|
|
35
|
+
*
|
|
36
|
+
* This component renders a group item.
|
|
37
|
+
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/User)
|
|
38
|
+
|
|
39
|
+
#### Import
|
|
40
|
+
|
|
41
|
+
```jsx
|
|
42
|
+
import {group} from '@selfcommunity/react-ui';
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
#### Component Name
|
|
46
|
+
|
|
47
|
+
The name `SCGroup` can be used when providing style overrides in the theme.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
#### CSS
|
|
51
|
+
|
|
52
|
+
|Rule Name|Global class|Description|
|
|
53
|
+
|---|---|---|
|
|
54
|
+
|root|.SCGroup-root|Styles applied to the root element.|
|
|
55
|
+
|avatar|.SCGroup-avatar|Styles applied to the avatar element.|
|
|
56
|
+
|
|
57
|
+
*
|
|
58
|
+
* @param inProps
|
|
59
|
+
*/
|
|
60
|
+
function Group(inProps) {
|
|
61
|
+
// PROPS
|
|
62
|
+
const props = (0, system_1.useThemeProps)({
|
|
63
|
+
props: inProps,
|
|
64
|
+
name: constants_1.PREFIX
|
|
65
|
+
});
|
|
66
|
+
const { groupId = null, group = null, handleIgnoreAction, className = null, elevation, hideActions = false, buttonProps = {}, visible = true } = props, rest = tslib_1.__rest(props, ["groupId", "group", "handleIgnoreAction", "className", "elevation", "hideActions", "buttonProps", "visible"]);
|
|
67
|
+
// STATE
|
|
68
|
+
const { scGroup } = (0, react_core_1.useSCFetchGroup)({ id: groupId, group });
|
|
69
|
+
// CONTEXT
|
|
70
|
+
const scRoutingContext = (0, react_core_1.useSCRouting)();
|
|
71
|
+
const [openAlert, setOpenAlert] = (0, react_1.useState)(false);
|
|
72
|
+
// INTL
|
|
73
|
+
const intl = (0, react_intl_1.useIntl)();
|
|
74
|
+
/**
|
|
75
|
+
* Render authenticated actions
|
|
76
|
+
* @return {JSX.Element}
|
|
77
|
+
*/
|
|
78
|
+
function renderAuthenticatedActions() {
|
|
79
|
+
return (react_1.default.createElement(material_1.Stack, { className: classes.actions, direction: "row", alignItems: "center", justifyContent: "center", spacing: 2 },
|
|
80
|
+
react_1.default.createElement(material_1.Icon, null, !visible ? 'private' : 'public'),
|
|
81
|
+
react_1.default.createElement(GroupSubscribeButton_1.default, { group: group, groupId: groupId })));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* Renders group object
|
|
85
|
+
*/
|
|
86
|
+
if (!scGroup) {
|
|
87
|
+
return react_1.default.createElement(Skeleton_1.default, { elevation: elevation });
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Renders root object
|
|
91
|
+
*/
|
|
92
|
+
return (react_1.default.createElement(react_1.default.Fragment, null,
|
|
93
|
+
react_1.default.createElement(Root, Object.assign({ elevation: elevation }, rest, { className: (0, classnames_1.default)(classes.root, className), ButtonBaseProps: buttonProps !== null && buttonProps !== void 0 ? buttonProps : { component: react_core_1.Link, to: scRoutingContext.url(react_core_1.SCRoutes.GROUP_ROUTE_NAME, scGroup) }, image: react_1.default.createElement(material_1.Avatar, { alt: scGroup.name, src: scGroup.image_medium, className: classes.avatar }), primary: scGroup.name, secondary: `${intl.formatMessage(messages.groupMembers, { total: scGroup.subscribers_counter })}`, actions: hideActions ? null : renderAuthenticatedActions() })),
|
|
94
|
+
openAlert && react_1.default.createElement(UserDeletedSnackBar_1.default, { open: openAlert, handleClose: () => setOpenAlert(false) })));
|
|
95
|
+
}
|
|
96
|
+
exports.default = Group;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { WidgetProps } from '../Widget';
|
|
2
|
+
/**
|
|
3
|
+
* > API documentation for the Community-JS Group Skeleton component. Learn about the available props and the CSS API.
|
|
4
|
+
|
|
5
|
+
#### Import
|
|
6
|
+
|
|
7
|
+
```jsx
|
|
8
|
+
import {GroupSkeleton} from '@selfcommunity/react-ui';
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
#### Component Name
|
|
12
|
+
|
|
13
|
+
The name `SCGroup-skeleton-root` can be used when providing style overrides in the theme.
|
|
14
|
+
|
|
15
|
+
#### CSS
|
|
16
|
+
|
|
17
|
+
|Rule Name|Global class|Description|
|
|
18
|
+
|---|---|---|
|
|
19
|
+
|root|.SCGroup-skeleton-root|Styles applied to the root element.|
|
|
20
|
+
*
|
|
21
|
+
*/
|
|
22
|
+
export default function GroupSkeleton(props: WidgetProps): JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
|
+
const material_1 = require("@mui/material");
|
|
6
|
+
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const Skeleton_1 = tslib_1.__importDefault(require("@mui/material/Skeleton"));
|
|
8
|
+
const BaseItem_1 = tslib_1.__importDefault(require("../../shared/BaseItem"));
|
|
9
|
+
const constants_1 = require("./constants");
|
|
10
|
+
const classes = {
|
|
11
|
+
root: `${constants_1.PREFIX}-skeleton-root`
|
|
12
|
+
};
|
|
13
|
+
const Root = (0, styles_1.styled)(BaseItem_1.default, {
|
|
14
|
+
name: constants_1.PREFIX,
|
|
15
|
+
slot: 'SkeletonRoot'
|
|
16
|
+
})(() => ({}));
|
|
17
|
+
/**
|
|
18
|
+
* > API documentation for the Community-JS Group Skeleton component. Learn about the available props and the CSS API.
|
|
19
|
+
|
|
20
|
+
#### Import
|
|
21
|
+
|
|
22
|
+
```jsx
|
|
23
|
+
import {GroupSkeleton} from '@selfcommunity/react-ui';
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
#### Component Name
|
|
27
|
+
|
|
28
|
+
The name `SCGroup-skeleton-root` can be used when providing style overrides in the theme.
|
|
29
|
+
|
|
30
|
+
#### CSS
|
|
31
|
+
|
|
32
|
+
|Rule Name|Global class|Description|
|
|
33
|
+
|---|---|---|
|
|
34
|
+
|root|.SCGroup-skeleton-root|Styles applied to the root element.|
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
function GroupSkeleton(props) {
|
|
38
|
+
const theme = (0, material_1.useTheme)();
|
|
39
|
+
return (react_1.default.createElement(Root, Object.assign({ className: classes.root }, props, { image: react_1.default.createElement(Skeleton_1.default, { animation: "wave", variant: "circular", width: theme.selfcommunity.user.avatar.sizeMedium, height: theme.selfcommunity.user.avatar.sizeMedium }), primary: react_1.default.createElement(Skeleton_1.default, { animation: "wave", height: 10, width: 120, style: { marginBottom: 10 } }), secondary: react_1.default.createElement(Skeleton_1.default, { animation: "wave", height: 10, width: 70, style: { marginBottom: 10 } }), actions: react_1.default.createElement(material_1.Button, { size: "small", variant: "outlined", disabled: true },
|
|
40
|
+
react_1.default.createElement(Skeleton_1.default, { animation: "wave", height: 10, width: 30, style: { marginTop: 5, marginBottom: 5 } })) })));
|
|
41
|
+
}
|
|
42
|
+
exports.default = GroupSkeleton;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PREFIX = "SCGroup";
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GroupSkeleton = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const Group_1 = tslib_1.__importDefault(require("./Group"));
|
|
6
|
+
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
7
|
+
exports.GroupSkeleton = Skeleton_1.default;
|
|
8
|
+
exports.default = Group_1.default;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SCGroupType } from '@selfcommunity/types';
|
|
3
|
+
import { ChangeGroupCoverProps } from '../ChangeGroupCover';
|
|
4
|
+
import { ChangeGroupPictureProps } from '../ChangeGroupPicture';
|
|
5
|
+
import { GroupMembersButtonProps } from '../GroupMembersButton';
|
|
6
|
+
export interface GroupHeaderProps {
|
|
7
|
+
/**
|
|
8
|
+
* Id of group object
|
|
9
|
+
* @default null
|
|
10
|
+
*/
|
|
11
|
+
id?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Overrides or extends the styles applied to the component.
|
|
14
|
+
* @default null
|
|
15
|
+
*/
|
|
16
|
+
className?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Group Object
|
|
19
|
+
* @default null
|
|
20
|
+
*/
|
|
21
|
+
group?: SCGroupType;
|
|
22
|
+
/**
|
|
23
|
+
* Id of the group
|
|
24
|
+
* @default null
|
|
25
|
+
*/
|
|
26
|
+
groupId?: number;
|
|
27
|
+
/**
|
|
28
|
+
* Props to spread change picture button
|
|
29
|
+
* @default {}
|
|
30
|
+
*/
|
|
31
|
+
ChangePictureProps?: ChangeGroupPictureProps;
|
|
32
|
+
/**
|
|
33
|
+
* Props to spread change cover button
|
|
34
|
+
* @default {}
|
|
35
|
+
*/
|
|
36
|
+
ChangeCoverProps?: ChangeGroupCoverProps;
|
|
37
|
+
/**
|
|
38
|
+
* Props to spread to the group memebers button
|
|
39
|
+
* @default {}
|
|
40
|
+
*/
|
|
41
|
+
GroupMembersButtonProps?: GroupMembersButtonProps;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
*/
|
|
45
|
+
actions?: React.ReactNode;
|
|
46
|
+
/**
|
|
47
|
+
* Any other properties
|
|
48
|
+
*/
|
|
49
|
+
[p: string]: any;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* > API documentation for the Community-JS Group Header component. Learn about the available props and the CSS API.
|
|
53
|
+
*
|
|
54
|
+
*
|
|
55
|
+
* This component renders the groups top section.
|
|
56
|
+
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/UserProfileHeader)
|
|
57
|
+
|
|
58
|
+
#### Import
|
|
59
|
+
|
|
60
|
+
```jsx
|
|
61
|
+
import {UserProfileHeader} from '@selfcommunity/react-ui';
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
#### Component Name
|
|
65
|
+
|
|
66
|
+
The name `SCGroupHeader` can be used when providing style overrides in the theme.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
#### CSS
|
|
70
|
+
|
|
71
|
+
|Rule Name|Global class|Description|
|
|
72
|
+
|---|---|---|
|
|
73
|
+
|root|.SCGroupHeader-root|Styles applied to the root element.|
|
|
74
|
+
|cover|.SCGroupHeader-cover|Styles applied to the cover element.|
|
|
75
|
+
|avatar|.SCGroupHeader-avatar|Styles applied to the avatar element.|
|
|
76
|
+
|info|SCGroupHeader-info|Styles applied to the info section.|
|
|
77
|
+
|name|SCGroupHeader-username|Styles applied to the username element.|
|
|
78
|
+
|changePicture|.SCGroupHeader-change-picture|Styles applied to changePicture element.|
|
|
79
|
+
|changeCover|.SCGroupHeader-change-cover`|Styles applied to changeCover element.|
|
|
80
|
+
|
|
81
|
+
* @param inProps
|
|
82
|
+
*/
|
|
83
|
+
export default function GroupHeader(inProps: GroupHeaderProps): JSX.Element;
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
5
|
+
const styles_1 = require("@mui/material/styles");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const types_1 = require("@selfcommunity/types");
|
|
8
|
+
const react_core_1 = require("@selfcommunity/react-core");
|
|
9
|
+
const Skeleton_1 = tslib_1.__importDefault(require("./Skeleton"));
|
|
10
|
+
const classnames_1 = tslib_1.__importDefault(require("classnames"));
|
|
11
|
+
const system_1 = require("@mui/system");
|
|
12
|
+
const constants_1 = require("./constants");
|
|
13
|
+
const ChangeGroupCover_1 = tslib_1.__importDefault(require("../ChangeGroupCover"));
|
|
14
|
+
const react_intl_1 = require("react-intl");
|
|
15
|
+
const Bullet_1 = tslib_1.__importDefault(require("../../shared/Bullet"));
|
|
16
|
+
const ChangeGroupPicture_1 = tslib_1.__importDefault(require("../ChangeGroupPicture"));
|
|
17
|
+
const GroupMembersButton_1 = tslib_1.__importDefault(require("../GroupMembersButton"));
|
|
18
|
+
const classes = {
|
|
19
|
+
root: `${constants_1.PREFIX}-root`,
|
|
20
|
+
cover: `${constants_1.PREFIX}-cover`,
|
|
21
|
+
avatar: `${constants_1.PREFIX}-avatar`,
|
|
22
|
+
info: `${constants_1.PREFIX}-info`,
|
|
23
|
+
name: `${constants_1.PREFIX}-name`,
|
|
24
|
+
changePicture: `${constants_1.PREFIX}-change-picture`,
|
|
25
|
+
changeCover: `${constants_1.PREFIX}-change-cover`,
|
|
26
|
+
visibility: `${constants_1.PREFIX}-visibility`,
|
|
27
|
+
visibilityItem: `${constants_1.PREFIX}-visibility-item`,
|
|
28
|
+
members: `${constants_1.PREFIX}-members`,
|
|
29
|
+
membersCounter: `${constants_1.PREFIX}-members-counter`
|
|
30
|
+
};
|
|
31
|
+
const Root = (0, styles_1.styled)(material_1.Box, {
|
|
32
|
+
name: constants_1.PREFIX,
|
|
33
|
+
slot: 'Root'
|
|
34
|
+
})(() => ({}));
|
|
35
|
+
/**
|
|
36
|
+
* > API documentation for the Community-JS Group Header component. Learn about the available props and the CSS API.
|
|
37
|
+
*
|
|
38
|
+
*
|
|
39
|
+
* This component renders the groups top section.
|
|
40
|
+
* Take a look at our <strong>demo</strong> component [here](/docs/sdk/community-js/react-ui/Components/UserProfileHeader)
|
|
41
|
+
|
|
42
|
+
#### Import
|
|
43
|
+
|
|
44
|
+
```jsx
|
|
45
|
+
import {UserProfileHeader} from '@selfcommunity/react-ui';
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
#### Component Name
|
|
49
|
+
|
|
50
|
+
The name `SCGroupHeader` can be used when providing style overrides in the theme.
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
#### CSS
|
|
54
|
+
|
|
55
|
+
|Rule Name|Global class|Description|
|
|
56
|
+
|---|---|---|
|
|
57
|
+
|root|.SCGroupHeader-root|Styles applied to the root element.|
|
|
58
|
+
|cover|.SCGroupHeader-cover|Styles applied to the cover element.|
|
|
59
|
+
|avatar|.SCGroupHeader-avatar|Styles applied to the avatar element.|
|
|
60
|
+
|info|SCGroupHeader-info|Styles applied to the info section.|
|
|
61
|
+
|name|SCGroupHeader-username|Styles applied to the username element.|
|
|
62
|
+
|changePicture|.SCGroupHeader-change-picture|Styles applied to changePicture element.|
|
|
63
|
+
|changeCover|.SCGroupHeader-change-cover`|Styles applied to changeCover element.|
|
|
64
|
+
|
|
65
|
+
* @param inProps
|
|
66
|
+
*/
|
|
67
|
+
function GroupHeader(inProps) {
|
|
68
|
+
var _a, _b;
|
|
69
|
+
// PROPS
|
|
70
|
+
const props = (0, system_1.useThemeProps)({
|
|
71
|
+
props: inProps,
|
|
72
|
+
name: constants_1.PREFIX
|
|
73
|
+
});
|
|
74
|
+
const { id = null, className = null, group, groupId = null, ChangePictureProps = {}, ChangeCoverProps = {}, GroupMembersButtonProps = {}, actions } = props, rest = tslib_1.__rest(props, ["id", "className", "group", "groupId", "ChangePictureProps", "ChangeCoverProps", "GroupMembersButtonProps", "actions"]);
|
|
75
|
+
// PREFERENCES
|
|
76
|
+
const scPreferences = (0, react_core_1.useSCPreferences)();
|
|
77
|
+
// CONTEXT
|
|
78
|
+
const scUserContext = (0, react_core_1.useSCUser)();
|
|
79
|
+
// HOOKS
|
|
80
|
+
const { scGroup, setSCGroup } = (0, react_core_1.useSCFetchGroup)({ id: groupId, group });
|
|
81
|
+
// CONST
|
|
82
|
+
const canEdit = (0, react_1.useMemo)(() => { var _a, _b; return scUserContext.user && (((_a = scGroup === null || scGroup === void 0 ? void 0 : scGroup.created_by) === null || _a === void 0 ? void 0 : _a.id) || ((_b = scGroup === null || scGroup === void 0 ? void 0 : scGroup.managed_by) === null || _b === void 0 ? void 0 : _b.id)) === scUserContext.user.id; }, [scUserContext.user, (_a = scGroup === null || scGroup === void 0 ? void 0 : scGroup.created_by) === null || _a === void 0 ? void 0 : _a.id, (_b = scGroup === null || scGroup === void 0 ? void 0 : scGroup.managed_by) === null || _b === void 0 ? void 0 : _b.id]);
|
|
83
|
+
/**
|
|
84
|
+
* Handles Change Avatar
|
|
85
|
+
* @param avatar
|
|
86
|
+
*/
|
|
87
|
+
function handleChangeAvatar(avatar) {
|
|
88
|
+
if (canEdit) {
|
|
89
|
+
setSCGroup(Object.assign({}, scGroup, { image_bigger: avatar }));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Handles Change Cover
|
|
94
|
+
* @param cover
|
|
95
|
+
*/
|
|
96
|
+
function handleChangeCover(cover) {
|
|
97
|
+
if (canEdit) {
|
|
98
|
+
setSCGroup(Object.assign({}, scGroup, { emotional_image: cover }));
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
// RENDER
|
|
102
|
+
if (!scGroup) {
|
|
103
|
+
return react_1.default.createElement(Skeleton_1.default, null);
|
|
104
|
+
}
|
|
105
|
+
const _backgroundCover = Object.assign({}, (scGroup.emotional_image
|
|
106
|
+
? { background: `url('${scGroup.emotional_image}') center / cover` }
|
|
107
|
+
: { background: `url('${scPreferences.preferences[react_core_1.SCPreferences.IMAGES_USER_DEFAULT_COVER].value}') center / cover` }));
|
|
108
|
+
return (react_1.default.createElement(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, rest),
|
|
109
|
+
react_1.default.createElement(material_1.Paper, { style: _backgroundCover, classes: { root: classes.cover } },
|
|
110
|
+
react_1.default.createElement(material_1.Box, { className: classes.avatar },
|
|
111
|
+
react_1.default.createElement(material_1.Avatar, null,
|
|
112
|
+
react_1.default.createElement("img", { alt: "group", src: scGroup.image_bigger ? scGroup.image_bigger : '' }))),
|
|
113
|
+
canEdit && (react_1.default.createElement(react_1.default.Fragment, null,
|
|
114
|
+
react_1.default.createElement(ChangeGroupPicture_1.default, Object.assign({ groupId: scGroup.id, onChange: handleChangeAvatar, className: classes.changePicture }, ChangePictureProps)),
|
|
115
|
+
react_1.default.createElement("div", { className: classes.changeCover },
|
|
116
|
+
react_1.default.createElement(ChangeGroupCover_1.default, Object.assign({ groupId: scGroup.id, onChange: handleChangeCover }, ChangeCoverProps)))))),
|
|
117
|
+
react_1.default.createElement(material_1.Box, { className: classes.info },
|
|
118
|
+
react_1.default.createElement(material_1.Typography, { variant: "h5", className: classes.name }, scGroup.name),
|
|
119
|
+
react_1.default.createElement(material_1.Box, { className: classes.visibility },
|
|
120
|
+
scGroup.privacy === types_1.SCGroupPrivacyType.PUBLIC ? (react_1.default.createElement(material_1.Typography, { className: classes.visibilityItem },
|
|
121
|
+
react_1.default.createElement(material_1.Icon, null, "public"),
|
|
122
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupHeader.visibility.public", defaultMessage: "ui.groupHeader.visibility.public" }))) : (react_1.default.createElement(material_1.Typography, { className: classes.visibilityItem },
|
|
123
|
+
react_1.default.createElement(material_1.Icon, null, "private"),
|
|
124
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupHeader.visibility.private", defaultMessage: "ui.groupHeader.visibility.private" }))),
|
|
125
|
+
react_1.default.createElement(Bullet_1.default, null),
|
|
126
|
+
scGroup.visible ? (react_1.default.createElement(material_1.Typography, { className: classes.visibilityItem },
|
|
127
|
+
react_1.default.createElement(material_1.Icon, null, "visibility"),
|
|
128
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupHeader.visibility.visible", defaultMessage: "ui.groupHeader.visibility.visible" }))) : (react_1.default.createElement(material_1.Typography, { className: classes.visibilityItem },
|
|
129
|
+
react_1.default.createElement(material_1.Icon, null, "visibility_off"),
|
|
130
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupHeader.visibility.hidden", defaultMessage: "ui.groupHeader.visibility.hidden" })))),
|
|
131
|
+
react_1.default.createElement(material_1.Box, { className: classes.members },
|
|
132
|
+
react_1.default.createElement(material_1.Typography, { className: classes.membersCounter, component: "div" },
|
|
133
|
+
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "ui.groupHeader.members", defaultMessage: "ui.groupHeader.members", values: { total: scGroup.subscribers_counter } })),
|
|
134
|
+
react_1.default.createElement(GroupMembersButton_1.default, Object.assign({ groupId: scGroup === null || scGroup === void 0 ? void 0 : scGroup.id, group: scGroup }, GroupMembersButtonProps))),
|
|
135
|
+
actions && actions)));
|
|
136
|
+
}
|
|
137
|
+
exports.default = GroupHeader;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* > API documentation for the Community-JS Group Headerr Skeleton component. Learn about the available props and the CSS API.
|
|
3
|
+
|
|
4
|
+
#### Import
|
|
5
|
+
|
|
6
|
+
```jsx
|
|
7
|
+
import {GroupHeaderSkeleton} from '@selfcommunity/react-ui';
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
#### Component Name
|
|
11
|
+
|
|
12
|
+
The name `SCGroupHeader-skeleton-root` can be used when providing style overrides in the theme.
|
|
13
|
+
|
|
14
|
+
#### CSS
|
|
15
|
+
|
|
16
|
+
|Rule Name|Global class|Description|
|
|
17
|
+
|---|---|---|
|
|
18
|
+
|root|.SCGroupHeader-skeleton-root|Styles applied to the root element.|
|
|
19
|
+
|avatar|.SCGroupHeader-avatar|Styles applied to the avatar element.|
|
|
20
|
+
|cover|.SCGroupHeader-cover|Styles applied to the cover element.|
|
|
21
|
+
|actions|.SCGroupHeader-actions|Styles applied to the actions section.|
|
|
22
|
+
|section|.SCGroupHeader-section|Styles applied to the info section.|
|
|
23
|
+
|username|.SCGroupHeader-username|Styles applied to the username element.|
|
|
24
|
+
*
|
|
25
|
+
*/
|
|
26
|
+
declare function GroupHeaderSkeleton(): JSX.Element;
|
|
27
|
+
export default GroupHeaderSkeleton;
|