@selfcommunity/react-templates 0.4.0-embeds.16 → 0.4.0
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/Group/Group.d.ts +6 -1
- package/lib/cjs/components/Group/Group.js +2 -2
- package/lib/esm/components/Group/Group.d.ts +6 -1
- package/lib/esm/components/Group/Group.js +2 -2
- package/lib/umd/{341.js → 555.js} +2 -2
- package/lib/umd/react-templates.js +1 -1
- package/package.json +6 -6
- /package/lib/umd/{341.js.LICENSE.txt → 555.js.LICENSE.txt} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FeedObjectProps, FeedSidebarProps, SCFeedWidgetType } from '@selfcommunity/react-ui';
|
|
1
|
+
import { FeedObjectProps, FeedSidebarProps, GroupHeaderProps, SCFeedWidgetType } from '@selfcommunity/react-ui';
|
|
2
2
|
import { SCGroupType } from '@selfcommunity/types';
|
|
3
3
|
import { GroupFeedProps } from '../GroupFeed';
|
|
4
4
|
export interface GroupProps {
|
|
@@ -42,6 +42,11 @@ export interface GroupProps {
|
|
|
42
42
|
* @default {}
|
|
43
43
|
*/
|
|
44
44
|
GroupFeedProps?: GroupFeedProps;
|
|
45
|
+
/**
|
|
46
|
+
* Props to spread Group Header component
|
|
47
|
+
* @default {}
|
|
48
|
+
*/
|
|
49
|
+
GroupHeaderProps?: GroupHeaderProps;
|
|
45
50
|
}
|
|
46
51
|
/**
|
|
47
52
|
* > API documentation for the Community-JS Category Template. Learn about the available props and the CSS API.
|
|
@@ -51,7 +51,7 @@ function Group(inProps) {
|
|
|
51
51
|
props: inProps,
|
|
52
52
|
name: constants_1.PREFIX
|
|
53
53
|
});
|
|
54
|
-
const { id = 'group', className, group, groupId, widgets, FeedObjectProps, FeedSidebarProps, GroupFeedProps = {} } = props;
|
|
54
|
+
const { id = 'group', className, group, groupId, widgets, FeedObjectProps, FeedSidebarProps, GroupFeedProps = {}, GroupHeaderProps = {} } = props;
|
|
55
55
|
// HOOKS
|
|
56
56
|
const { scGroup, setSCGroup } = (0, react_core_1.useSCFetchGroup)({ id: groupId, group });
|
|
57
57
|
const handleSubscribe = (group, status) => {
|
|
@@ -60,6 +60,6 @@ function Group(inProps) {
|
|
|
60
60
|
if (!scGroup) {
|
|
61
61
|
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
|
|
62
62
|
}
|
|
63
|
-
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.GroupHeader, { groupId: scGroup.id, GroupSubscribeButtonProps: { onSubscribe: handleSubscribe } }), (0, jsx_runtime_1.jsx)(GroupFeed_1.default, Object.assign({ className: classes.feed, group: scGroup, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, GroupFeedProps))] })));
|
|
63
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className) }, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.GroupHeader, Object.assign({ groupId: scGroup.id, GroupSubscribeButtonProps: { onSubscribe: handleSubscribe } }, GroupHeaderProps)), (0, jsx_runtime_1.jsx)(GroupFeed_1.default, Object.assign({ className: classes.feed, group: scGroup, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, GroupFeedProps))] })));
|
|
64
64
|
}
|
|
65
65
|
exports.default = Group;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FeedObjectProps, FeedSidebarProps, SCFeedWidgetType } from '@selfcommunity/react-ui';
|
|
1
|
+
import { FeedObjectProps, FeedSidebarProps, GroupHeaderProps, SCFeedWidgetType } from '@selfcommunity/react-ui';
|
|
2
2
|
import { SCGroupType } from '@selfcommunity/types';
|
|
3
3
|
import { GroupFeedProps } from '../GroupFeed';
|
|
4
4
|
export interface GroupProps {
|
|
@@ -42,6 +42,11 @@ export interface GroupProps {
|
|
|
42
42
|
* @default {}
|
|
43
43
|
*/
|
|
44
44
|
GroupFeedProps?: GroupFeedProps;
|
|
45
|
+
/**
|
|
46
|
+
* Props to spread Group Header component
|
|
47
|
+
* @default {}
|
|
48
|
+
*/
|
|
49
|
+
GroupHeaderProps?: GroupHeaderProps;
|
|
45
50
|
}
|
|
46
51
|
/**
|
|
47
52
|
* > API documentation for the Community-JS Category Template. Learn about the available props and the CSS API.
|
|
@@ -48,7 +48,7 @@ export default function Group(inProps) {
|
|
|
48
48
|
props: inProps,
|
|
49
49
|
name: PREFIX
|
|
50
50
|
});
|
|
51
|
-
const { id = 'group', className, group, groupId, widgets, FeedObjectProps, FeedSidebarProps, GroupFeedProps = {} } = props;
|
|
51
|
+
const { id = 'group', className, group, groupId, widgets, FeedObjectProps, FeedSidebarProps, GroupFeedProps = {}, GroupHeaderProps = {} } = props;
|
|
52
52
|
// HOOKS
|
|
53
53
|
const { scGroup, setSCGroup } = useSCFetchGroup({ id: groupId, group });
|
|
54
54
|
const handleSubscribe = (group, status) => {
|
|
@@ -57,5 +57,5 @@ export default function Group(inProps) {
|
|
|
57
57
|
if (!scGroup) {
|
|
58
58
|
return _jsx(GroupSkeletonTemplate, {});
|
|
59
59
|
}
|
|
60
|
-
return (_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, { children: [_jsx(GroupHeader, { groupId: scGroup.id, GroupSubscribeButtonProps: { onSubscribe: handleSubscribe } }), _jsx(GroupFeed, Object.assign({ className: classes.feed, group: scGroup, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, GroupFeedProps))] })));
|
|
60
|
+
return (_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, { children: [_jsx(GroupHeader, Object.assign({ groupId: scGroup.id, GroupSubscribeButtonProps: { onSubscribe: handleSubscribe } }, GroupHeaderProps)), _jsx(GroupFeed, Object.assign({ className: classes.feed, group: scGroup, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, GroupFeedProps))] })));
|
|
61
61
|
}
|