@selfcommunity/react-templates 0.3.50-events.41 → 0.3.50-events.44
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/Category/Category.js +3 -5
- package/lib/cjs/components/Category/Skeleton.js +2 -4
- package/lib/cjs/components/CategoryFeed/CategoryFeed.js +7 -7
- package/lib/cjs/components/CategoryFeed/Skeleton.js +2 -5
- package/lib/cjs/components/Event/Event.js +3 -5
- package/lib/cjs/components/Event/Skeleton.js +2 -4
- package/lib/cjs/components/EventFeed/EventFeed.js +10 -12
- package/lib/cjs/components/EventFeed/Skeleton.js +2 -5
- package/lib/cjs/components/ExploreFeed/ExploreFeed.js +5 -4
- package/lib/cjs/components/ExploreFeed/Skeleton.js +2 -5
- package/lib/cjs/components/FeedObjectDetail/FeedObjectDetail.js +6 -15
- package/lib/cjs/components/FeedObjectDetail/Skeleton.js +2 -9
- package/lib/cjs/components/Group/Group.js +3 -5
- package/lib/cjs/components/Group/Skeleton.js +2 -4
- package/lib/cjs/components/GroupFeed/GroupFeed.js +8 -8
- package/lib/cjs/components/GroupFeed/Skeleton.js +2 -5
- package/lib/cjs/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +6 -35
- package/lib/cjs/components/LoyaltyProgramDetail/PointsList.js +4 -17
- package/lib/cjs/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +2 -14
- package/lib/cjs/components/LoyaltyProgramDetail/Skeleton.js +2 -16
- package/lib/cjs/components/MainFeed/MainFeed.js +5 -4
- package/lib/cjs/components/MainFeed/Skeleton.js +2 -5
- package/lib/cjs/components/NotificationFeed/NotificationFeed.js +3 -2
- package/lib/cjs/components/NotificationFeed/Skeleton.js +2 -3
- package/lib/cjs/components/UserFeed/Skeleton.js +2 -5
- package/lib/cjs/components/UserFeed/UserFeed.js +6 -5
- package/lib/cjs/components/UserProfile/Skeleton.js +2 -4
- package/lib/cjs/components/UserProfile/UserProfile.js +13 -30
- package/lib/esm/components/Category/Category.js +3 -5
- package/lib/esm/components/Category/Skeleton.js +2 -4
- package/lib/esm/components/CategoryFeed/CategoryFeed.js +7 -7
- package/lib/esm/components/CategoryFeed/Skeleton.js +2 -5
- package/lib/esm/components/Event/Event.js +3 -5
- package/lib/esm/components/Event/Skeleton.js +2 -4
- package/lib/esm/components/EventFeed/EventFeed.js +10 -12
- package/lib/esm/components/EventFeed/Skeleton.js +2 -5
- package/lib/esm/components/ExploreFeed/ExploreFeed.js +5 -4
- package/lib/esm/components/ExploreFeed/Skeleton.js +2 -5
- package/lib/esm/components/FeedObjectDetail/FeedObjectDetail.js +6 -15
- package/lib/esm/components/FeedObjectDetail/Skeleton.js +2 -8
- package/lib/esm/components/Group/Group.js +3 -5
- package/lib/esm/components/Group/Skeleton.js +2 -4
- package/lib/esm/components/GroupFeed/GroupFeed.js +8 -8
- package/lib/esm/components/GroupFeed/Skeleton.js +2 -5
- package/lib/esm/components/LoyaltyProgramDetail/LoyaltyProgramDetail.js +6 -35
- package/lib/esm/components/LoyaltyProgramDetail/PointsList.js +4 -17
- package/lib/esm/components/LoyaltyProgramDetail/PrizeItemSkeleton.js +2 -13
- package/lib/esm/components/LoyaltyProgramDetail/Skeleton.js +2 -16
- package/lib/esm/components/MainFeed/MainFeed.js +5 -4
- package/lib/esm/components/MainFeed/Skeleton.js +2 -5
- package/lib/esm/components/NotificationFeed/NotificationFeed.js +3 -2
- package/lib/esm/components/NotificationFeed/Skeleton.js +2 -3
- package/lib/esm/components/UserFeed/Skeleton.js +2 -5
- package/lib/esm/components/UserFeed/UserFeed.js +6 -5
- package/lib/esm/components/UserProfile/Skeleton.js +2 -4
- package/lib/esm/components/UserProfile/UserProfile.js +13 -30
- package/lib/umd/react-templates.js +1 -1
- package/package.json +6 -6
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PointElement = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
6
|
+
const react_1 = require("react");
|
|
6
7
|
const styles_1 = require("@mui/material/styles");
|
|
7
8
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
8
9
|
const material_1 = require("@mui/material");
|
|
@@ -25,13 +26,7 @@ const classes = {
|
|
|
25
26
|
};
|
|
26
27
|
function PointElement({ message, points }) {
|
|
27
28
|
if (points > 0) {
|
|
28
|
-
return (
|
|
29
|
-
react_1.default.createElement(material_1.Typography, { component: "div", className: classes.element },
|
|
30
|
-
react_1.default.createElement(material_1.Typography, null, message),
|
|
31
|
-
react_1.default.createElement(material_1.Typography, null,
|
|
32
|
-
"+",
|
|
33
|
-
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points", defaultMessage: "templates.loyaltyProgramDetail.points", values: { total: points } }))),
|
|
34
|
-
react_1.default.createElement(material_1.Divider, null)));
|
|
29
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6 }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ component: "div", className: classes.element }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { children: message }), (0, jsx_runtime_1.jsxs)(material_1.Typography, { children: ["+", (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points", defaultMessage: "templates.loyaltyProgramDetail.points", values: { total: points } })] })] })), (0, jsx_runtime_1.jsx)(material_1.Divider, {})] })));
|
|
35
30
|
}
|
|
36
31
|
}
|
|
37
32
|
exports.PointElement = PointElement;
|
|
@@ -57,14 +52,6 @@ function PointsList(props) {
|
|
|
57
52
|
/**
|
|
58
53
|
* Renders the component (if not hidden by autoHide prop)
|
|
59
54
|
*/
|
|
60
|
-
return (
|
|
61
|
-
preferences[react_core_1.SCPreferences.CONFIGURATIONS_POST_TYPE_ENABLED].value && (react_1.default.createElement(PointElement, { message: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.post", defaultMessage: "templates.loyaltyProgramDetail.points.post" }), points: _preferences[react_core_1.SCPreferences.POINTS_MAKE_POST] })),
|
|
62
|
-
preferences[react_core_1.SCPreferences.CONFIGURATIONS_DISCUSSION_TYPE_ENABLED].value && (react_1.default.createElement(PointElement, { message: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.discussion", defaultMessage: "templates.loyaltyProgramDetail.points.discussion" }), points: _preferences[react_core_1.SCPreferences.POINTS_MAKE_DISCUSSION] })),
|
|
63
|
-
react_1.default.createElement(PointElement, { message: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.comment", defaultMessage: "templates.loyaltyProgramDetail.points.comment" }), points: _preferences[react_core_1.SCPreferences.POINTS_MAKE_COMMENT] }),
|
|
64
|
-
react_1.default.createElement(PointElement, { message: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.appreciation", defaultMessage: "templates.loyaltyProgramDetail.points.appreciation" }), points: _preferences[react_core_1.SCPreferences.POINTS_RECEIVE_VOTE] }),
|
|
65
|
-
react_1.default.createElement(PointElement, { message: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.follower", defaultMessage: "templates.loyaltyProgramDetail.points.follower" }), points: _preferences[react_core_1.SCPreferences.POINTS_CONNECTION_OR_FOLLOWER] }),
|
|
66
|
-
react_1.default.createElement(PointElement, { message: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.share", defaultMessage: "templates.loyaltyProgramDetail.points.share" }), points: _preferences[react_core_1.SCPreferences.POINTS_SOCIAL_SHARE] }),
|
|
67
|
-
react_1.default.createElement(PointElement, { message: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.app", defaultMessage: "templates.loyaltyProgramDetail.points.app" }), points: _preferences[react_core_1.SCPreferences.POINTS_APP_USED] }),
|
|
68
|
-
react_1.default.createElement(PointElement, { message: react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.visit", defaultMessage: "templates.loyaltyProgramDetail.points.visit" }), points: _preferences[react_core_1.SCPreferences.POINTS_DAILY_VISIT] })));
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: (0, classnames_1.default)(classes.root, className), container: true, spacing: 2 }, rest, { children: [preferences[react_core_1.SCPreferences.CONFIGURATIONS_POST_TYPE_ENABLED].value && ((0, jsx_runtime_1.jsx)(PointElement, { message: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.post", defaultMessage: "templates.loyaltyProgramDetail.points.post" }), points: _preferences[react_core_1.SCPreferences.POINTS_MAKE_POST] })), preferences[react_core_1.SCPreferences.CONFIGURATIONS_DISCUSSION_TYPE_ENABLED].value && ((0, jsx_runtime_1.jsx)(PointElement, { message: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.discussion", defaultMessage: "templates.loyaltyProgramDetail.points.discussion" }), points: _preferences[react_core_1.SCPreferences.POINTS_MAKE_DISCUSSION] })), (0, jsx_runtime_1.jsx)(PointElement, { message: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.comment", defaultMessage: "templates.loyaltyProgramDetail.points.comment" }), points: _preferences[react_core_1.SCPreferences.POINTS_MAKE_COMMENT] }), (0, jsx_runtime_1.jsx)(PointElement, { message: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.appreciation", defaultMessage: "templates.loyaltyProgramDetail.points.appreciation" }), points: _preferences[react_core_1.SCPreferences.POINTS_RECEIVE_VOTE] }), (0, jsx_runtime_1.jsx)(PointElement, { message: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.follower", defaultMessage: "templates.loyaltyProgramDetail.points.follower" }), points: _preferences[react_core_1.SCPreferences.POINTS_CONNECTION_OR_FOLLOWER] }), (0, jsx_runtime_1.jsx)(PointElement, { message: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.share", defaultMessage: "templates.loyaltyProgramDetail.points.share" }), points: _preferences[react_core_1.SCPreferences.POINTS_SOCIAL_SHARE] }), (0, jsx_runtime_1.jsx)(PointElement, { message: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.app", defaultMessage: "templates.loyaltyProgramDetail.points.app" }), points: _preferences[react_core_1.SCPreferences.POINTS_APP_USED] }), (0, jsx_runtime_1.jsx)(PointElement, { message: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "templates.loyaltyProgramDetail.points.visit", defaultMessage: "templates.loyaltyProgramDetail.points.visit" }), points: _preferences[react_core_1.SCPreferences.POINTS_DAILY_VISIT] })] })));
|
|
69
56
|
}
|
|
70
57
|
exports.default = PointsList;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const
|
|
4
|
-
const react_1 = tslib_1.__importDefault(require("react"));
|
|
3
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
4
|
const styles_1 = require("@mui/material/styles");
|
|
6
5
|
const material_1 = require("@mui/material");
|
|
7
6
|
const react_ui_1 = require("@selfcommunity/react-ui");
|
|
@@ -32,17 +31,6 @@ const Root = (0, styles_1.styled)(react_ui_1.Widget, {
|
|
|
32
31
|
*
|
|
33
32
|
*/
|
|
34
33
|
function PrizeItemSkeleton() {
|
|
35
|
-
return (
|
|
36
|
-
react_1.default.createElement(material_1.CardMedia, null,
|
|
37
|
-
react_1.default.createElement(material_1.Skeleton, { animation: "wave", variant: "rectangular", width: "100%", height: 137 })),
|
|
38
|
-
react_1.default.createElement(material_1.CardContent, null,
|
|
39
|
-
react_1.default.createElement(material_1.Typography, { className: classes.content },
|
|
40
|
-
react_1.default.createElement(material_1.Skeleton, { animation: "wave", height: 20, width: "80%", variant: "text" }),
|
|
41
|
-
react_1.default.createElement(material_1.Skeleton, { animation: "wave", height: 10, width: "70%", variant: "text", style: { marginTop: 8 } }))),
|
|
42
|
-
react_1.default.createElement(material_1.CardActions, { className: classes.actions },
|
|
43
|
-
react_1.default.createElement(material_1.Button, { disabled: true, variant: 'outlined', size: 'small' },
|
|
44
|
-
react_1.default.createElement(material_1.Skeleton, { animation: "wave", height: 10, width: 50, variant: "text" })),
|
|
45
|
-
react_1.default.createElement(material_1.Button, { disabled: true, variant: 'text', size: 'small' },
|
|
46
|
-
react_1.default.createElement(material_1.Skeleton, { animation: "wave", height: 20, width: 70, variant: "text" })))));
|
|
34
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsx)(material_1.CardMedia, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "rectangular", width: "100%", height: 137 }) }), (0, jsx_runtime_1.jsx)(material_1.CardContent, { children: (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.content }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 20, width: "80%", variant: "text" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 10, width: "70%", variant: "text", style: { marginTop: 8 } })] })) }), (0, jsx_runtime_1.jsxs)(material_1.CardActions, Object.assign({ className: classes.actions }, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ disabled: true, variant: 'outlined', size: 'small' }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 10, width: 50, variant: "text" }) })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ disabled: true, variant: 'text', size: 'small' }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 20, width: 70, variant: "text" }) }))] }))] })));
|
|
47
35
|
}
|
|
48
36
|
exports.default = PrizeItemSkeleton;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const styles_1 = require("@mui/material/styles");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const PrizeItemSkeleton_1 = tslib_1.__importDefault(require("./PrizeItemSkeleton"));
|
|
@@ -46,20 +46,6 @@ const Root = (0, styles_1.styled)(material_1.Box, {
|
|
|
46
46
|
function LoyaltyProgramDetailSkeleton() {
|
|
47
47
|
const theme = (0, material_1.useTheme)();
|
|
48
48
|
const isMobile = (0, material_1.useMediaQuery)(theme.breakpoints.down('md'));
|
|
49
|
-
return (
|
|
50
|
-
react_1.default.createElement(material_1.Typography, { className: classes.title, component: 'div' },
|
|
51
|
-
!isMobile && react_1.default.createElement(material_1.Skeleton, { animation: "wave", height: 30, width: 140, variant: "text" }),
|
|
52
|
-
react_1.default.createElement(material_1.Skeleton, { animation: "wave", variant: "circular", width: 172, height: 30, className: classes.chip })),
|
|
53
|
-
react_1.default.createElement(material_1.Typography, { className: classes.sectionTitle },
|
|
54
|
-
react_1.default.createElement(material_1.Skeleton, { animation: "wave", height: 20, width: '50%', variant: "text" }),
|
|
55
|
-
react_1.default.createElement(material_1.Skeleton, { animation: "wave", height: 17, width: '80%', variant: "text", className: classes.subTitle })),
|
|
56
|
-
react_1.default.createElement(material_1.Typography, { className: classes.sectionTitle },
|
|
57
|
-
react_1.default.createElement(material_1.Skeleton, { animation: "wave", height: 20, width: 146 })),
|
|
58
|
-
react_1.default.createElement(material_1.Grid, { container: true, spacing: 2, className: classes.pointsList }, [...Array(8)].map((prize, index) => (react_1.default.createElement(material_1.Grid, { item: true, xs: 12, sm: 12, md: 6, key: index },
|
|
59
|
-
react_1.default.createElement(material_1.Skeleton, { animation: "wave", height: 15, width: "100%" }))))),
|
|
60
|
-
react_1.default.createElement(material_1.Typography, { className: classes.sectionTitle },
|
|
61
|
-
react_1.default.createElement(material_1.Skeleton, { animation: "wave", height: 20, width: 140, variant: "text" })),
|
|
62
|
-
react_1.default.createElement(material_1.Grid, { container: true, spacing: isMobile ? 3 : 6 }, [...Array(6)].map((prize, index) => (react_1.default.createElement(material_1.Grid, { item: true, xs: 12, sm: 12, md: 6, lg: 4, key: index },
|
|
63
|
-
react_1.default.createElement(PrizeItemSkeleton_1.default, null)))))));
|
|
49
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.title, component: 'div' }, { children: [!isMobile && (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 30, width: 140, variant: "text" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", variant: "circular", width: 172, height: 30, className: classes.chip })] })), (0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.sectionTitle }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 20, width: '50%', variant: "text" }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 17, width: '80%', variant: "text", className: classes.subTitle })] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.sectionTitle }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 20, width: 146 }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: 2, className: classes.pointsList }, { children: [...Array(8)].map((prize, index) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6 }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 15, width: "100%" }) }), index))) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.sectionTitle }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 20, width: 140, variant: "text" }) })), (0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ container: true, spacing: isMobile ? 3 : 6 }, { children: [...Array(6)].map((prize, index) => ((0, jsx_runtime_1.jsx)(material_1.Grid, Object.assign({ item: true, xs: 12, sm: 12, md: 6, lg: 4 }, { children: (0, jsx_runtime_1.jsx)(PrizeItemSkeleton_1.default, {}) }), index))) }))] })));
|
|
64
50
|
}
|
|
65
51
|
exports.default = LoyaltyProgramDetailSkeleton;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const styles_1 = require("@mui/material/styles");
|
|
6
7
|
const react_ui_1 = require("@selfcommunity/react-ui");
|
|
7
8
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
@@ -93,7 +94,7 @@ function MainFeed(inProps) {
|
|
|
93
94
|
}
|
|
94
95
|
// HANDLERS
|
|
95
96
|
const handleComposerSuccess = (feedObject) => {
|
|
96
|
-
enqueueSnackbar(
|
|
97
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.inlineComposerWidget.success", defaultMessage: "ui.inlineComposerWidget.success" }), {
|
|
97
98
|
variant: 'success',
|
|
98
99
|
autoHideDuration: 3000
|
|
99
100
|
});
|
|
@@ -106,14 +107,14 @@ function MainFeed(inProps) {
|
|
|
106
107
|
};
|
|
107
108
|
feedRef && feedRef.current && feedRef.current.addFeedData(feedUnit, true);
|
|
108
109
|
};
|
|
109
|
-
return (
|
|
110
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className), ref: feedRef, endpoint: api_services_1.Endpoints.MainFeed, widgets: widgets, ItemComponent: react_ui_1.FeedObject, itemPropsGenerator: (scUser, item) => ({
|
|
110
111
|
feedObject: item[item.type],
|
|
111
112
|
feedObjectType: item.type,
|
|
112
113
|
feedObjectActivities: item.activities ? item.activities : null,
|
|
113
114
|
markRead: scUser ? !item.seen_by_id.includes(scUser.id) : null
|
|
114
115
|
}), itemIdGenerator: (item) => item[item.type].id, ItemProps: FeedObjectProps, ItemSkeleton: react_ui_1.FeedObjectSkeleton, ItemSkeletonProps: {
|
|
115
116
|
template: react_ui_1.SCFeedObjectTemplateType.PREVIEW
|
|
116
|
-
}, FeedSidebarProps: FeedSidebarProps, HeaderComponent:
|
|
117
|
+
}, FeedSidebarProps: FeedSidebarProps, HeaderComponent: (0, jsx_runtime_1.jsx)(react_ui_1.InlineComposerWidget, { onSuccess: handleComposerSuccess }), requireAuthentication: true, disablePaginationLinks: true, enabledCustomAdvPositions: [
|
|
117
118
|
types_1.SCCustomAdvPosition.POSITION_FEED_SIDEBAR,
|
|
118
119
|
types_1.SCCustomAdvPosition.POSITION_FEED,
|
|
119
120
|
types_1.SCCustomAdvPosition.POSITION_BELOW_TOPBAR
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const styles_1 = require("@mui/material/styles");
|
|
6
7
|
const react_ui_1 = require("@selfcommunity/react-ui");
|
|
@@ -33,10 +34,6 @@ const Root = (0, styles_1.styled)(react_ui_1.FeedSkeleton, {
|
|
|
33
34
|
*
|
|
34
35
|
*/
|
|
35
36
|
function MainFeedSkeleton() {
|
|
36
|
-
return (
|
|
37
|
-
react_1.default.createElement(react_ui_1.GenericSkeleton, { sx: { mb: 2 } }),
|
|
38
|
-
react_1.default.createElement(react_ui_1.GenericSkeleton, { sx: { mb: 2 } })) },
|
|
39
|
-
react_1.default.createElement(react_ui_1.InlineComposerWidgetSkeleton, null),
|
|
40
|
-
Array.from({ length: 5 }).map((e, i) => (react_1.default.createElement(react_ui_1.FeedObjectSkeleton, { key: i, template: react_ui_1.SCFeedObjectTemplateType.DETAIL })))));
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root, sidebar: (0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.GenericSkeleton, { sx: { mb: 2 } }), (0, jsx_runtime_1.jsx)(react_ui_1.GenericSkeleton, { sx: { mb: 2 } })] }) }, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.InlineComposerWidgetSkeleton, {}), Array.from({ length: 5 }).map((e, i) => ((0, jsx_runtime_1.jsx)(react_ui_1.FeedObjectSkeleton, { template: react_ui_1.SCFeedObjectTemplateType.DETAIL }, i)))] })));
|
|
41
38
|
}
|
|
42
39
|
exports.default = MainFeedSkeleton;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const styles_1 = require("@mui/material/styles");
|
|
6
7
|
const react_ui_1 = require("@selfcommunity/react-ui");
|
|
7
8
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
@@ -116,7 +117,7 @@ function NotificationFeed(inProps) {
|
|
|
116
117
|
void scUserContext.refreshCounters();
|
|
117
118
|
}
|
|
118
119
|
};
|
|
119
|
-
return (
|
|
120
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className), endpoint: api_services_1.Endpoints.UserNotificationList, widgets: widgets, ItemComponent: react_ui_1.Notification, itemPropsGenerator: (scUser, item) => ({
|
|
120
121
|
notificationObject: item
|
|
121
122
|
}), itemIdGenerator: (item) => item.sid, ItemProps: NotificationProps, ItemSkeleton: react_ui_1.NotificationSkeleton, ItemSkeletonProps: {
|
|
122
123
|
template: react_ui_1.SCFeedObjectTemplateType.PREVIEW
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const styles_1 = require("@mui/material/styles");
|
|
6
7
|
const react_ui_1 = require("@selfcommunity/react-ui");
|
|
@@ -33,8 +34,6 @@ const Root = (0, styles_1.styled)(react_ui_1.FeedSkeleton, {
|
|
|
33
34
|
*
|
|
34
35
|
*/
|
|
35
36
|
function NotificationFeedSkeleton() {
|
|
36
|
-
return (
|
|
37
|
-
react_1.default.createElement(react_ui_1.GenericSkeleton, { sx: { mb: 2 } }),
|
|
38
|
-
react_1.default.createElement(react_ui_1.GenericSkeleton, { sx: { mb: 2 } })) }, Array.from({ length: 5 }).map((e, i) => (react_1.default.createElement(react_ui_1.NotificationSkeleton, { key: i })))));
|
|
37
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ className: classes.root, sidebar: (0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.GenericSkeleton, { sx: { mb: 2 } }), (0, jsx_runtime_1.jsx)(react_ui_1.GenericSkeleton, { sx: { mb: 2 } })] }) }, { children: Array.from({ length: 5 }).map((e, i) => ((0, jsx_runtime_1.jsx)(react_ui_1.NotificationSkeleton, {}, i))) })));
|
|
39
38
|
}
|
|
40
39
|
exports.default = NotificationFeedSkeleton;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
4
5
|
const react_1 = tslib_1.__importDefault(require("react"));
|
|
5
6
|
const styles_1 = require("@mui/material/styles");
|
|
6
7
|
const react_ui_1 = require("@selfcommunity/react-ui");
|
|
@@ -33,10 +34,6 @@ const Root = (0, styles_1.styled)(react_ui_1.FeedSkeleton, {
|
|
|
33
34
|
*
|
|
34
35
|
*/
|
|
35
36
|
function UserFeedSkeleton() {
|
|
36
|
-
return (
|
|
37
|
-
react_1.default.createElement(react_ui_1.GenericSkeleton, { sx: { mb: 2 } }),
|
|
38
|
-
react_1.default.createElement(react_ui_1.GenericSkeleton, { sx: { mb: 2 } })) },
|
|
39
|
-
react_1.default.createElement(react_ui_1.InlineComposerWidgetSkeleton, null),
|
|
40
|
-
Array.from({ length: 5 }).map((e, i) => (react_1.default.createElement(react_ui_1.FeedObjectSkeleton, { key: i, template: react_ui_1.SCFeedObjectTemplateType.DETAIL })))));
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root, sidebar: (0, jsx_runtime_1.jsxs)(react_1.default.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.GenericSkeleton, { sx: { mb: 2 } }), (0, jsx_runtime_1.jsx)(react_ui_1.GenericSkeleton, { sx: { mb: 2 } })] }) }, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.InlineComposerWidgetSkeleton, {}), Array.from({ length: 5 }).map((e, i) => ((0, jsx_runtime_1.jsx)(react_ui_1.FeedObjectSkeleton, { template: react_ui_1.SCFeedObjectTemplateType.DETAIL }, i)))] })));
|
|
41
38
|
}
|
|
42
39
|
exports.default = UserFeedSkeleton;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const styles_1 = require("@mui/material/styles");
|
|
6
7
|
const api_services_1 = require("@selfcommunity/api-services");
|
|
7
8
|
const react_core_1 = require("@selfcommunity/react-core");
|
|
@@ -84,7 +85,7 @@ function UserFeed(inProps) {
|
|
|
84
85
|
const feedRef = (0, react_1.useRef)();
|
|
85
86
|
// HANDLERS
|
|
86
87
|
const handleComposerSuccess = (feedObject) => {
|
|
87
|
-
enqueueSnackbar(
|
|
88
|
+
enqueueSnackbar((0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "ui.inlineComposerWidget.success", defaultMessage: "ui.inlineComposerWidget.success" }), {
|
|
88
89
|
variant: 'success',
|
|
89
90
|
autoHideDuration: 3000
|
|
90
91
|
});
|
|
@@ -102,14 +103,14 @@ function UserFeed(inProps) {
|
|
|
102
103
|
return Object.assign(Object.assign({}, w), { componentProps: Object.assign(Object.assign({}, w.componentProps), { userId: scUser ? scUser.id : userId }) });
|
|
103
104
|
}), [scUser, widgets]);
|
|
104
105
|
if (scUser === null) {
|
|
105
|
-
return
|
|
106
|
+
return (0, jsx_runtime_1.jsx)(index_1.UserFeedSkeleton, {});
|
|
106
107
|
}
|
|
107
|
-
return (
|
|
108
|
+
return ((0, jsx_runtime_1.jsx)(Root, Object.assign({ id: id, className: (0, classnames_1.default)(classes.root, className), ref: feedRef, endpoint: Object.assign(Object.assign({}, api_services_1.Endpoints.UserFeed), { url: () => api_services_1.Endpoints.UserFeed.url({ id: scUser.id }) }), widgets: _widgets, ItemComponent: react_ui_1.FeedObject, itemPropsGenerator: (scUser, item) => ({
|
|
108
109
|
feedObject: item[item.type],
|
|
109
110
|
feedObjectType: item.type,
|
|
110
111
|
feedObjectActivities: item.activities ? item.activities : null
|
|
111
112
|
}), itemIdGenerator: (item) => item[item.type].id, ItemProps: FeedObjectProps, ItemSkeleton: react_ui_1.FeedObjectSkeleton, ItemSkeletonProps: {
|
|
112
113
|
template: react_ui_1.SCFeedObjectTemplateType.PREVIEW
|
|
113
|
-
} }, (scUserContext.user ? { HeaderComponent:
|
|
114
|
+
} }, (scUserContext.user ? { HeaderComponent: (0, jsx_runtime_1.jsx)(react_ui_1.InlineComposerWidget, { onSuccess: handleComposerSuccess }) } : {}), { FeedSidebarProps: FeedSidebarProps }, FeedProps)));
|
|
114
115
|
}
|
|
115
116
|
exports.default = UserFeed;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const styles_1 = require("@mui/material/styles");
|
|
7
7
|
const react_ui_1 = require("@selfcommunity/react-ui");
|
|
@@ -35,8 +35,6 @@ const Root = (0, styles_1.styled)(material_1.Box, {
|
|
|
35
35
|
*
|
|
36
36
|
*/
|
|
37
37
|
function UserProfileSkeleton() {
|
|
38
|
-
return (
|
|
39
|
-
react_1.default.createElement(react_ui_1.UserProfileHeaderSkeleton, null),
|
|
40
|
-
react_1.default.createElement(Skeleton_1.default, null)));
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(Root, Object.assign({ className: classes.root }, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.UserProfileHeaderSkeleton, {}), (0, jsx_runtime_1.jsx)(Skeleton_1.default, {})] })));
|
|
41
39
|
}
|
|
42
40
|
exports.default = UserProfileSkeleton;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const tslib_1 = require("tslib");
|
|
4
|
-
const
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_1 = require("react");
|
|
5
6
|
const styles_1 = require("@mui/material/styles");
|
|
6
7
|
const material_1 = require("@mui/material");
|
|
7
8
|
const react_ui_1 = require("@selfcommunity/react-ui");
|
|
@@ -205,7 +206,7 @@ function UserProfile(inProps) {
|
|
|
205
206
|
}
|
|
206
207
|
}, [isConnection, scUserContext.managers.followers, scUserContext.managers.connections, followEnabled, isMe, user, scUserContext.user]);
|
|
207
208
|
if (!scUser) {
|
|
208
|
-
return
|
|
209
|
+
return (0, jsx_runtime_1.jsx)(Skeleton_1.default, {});
|
|
209
210
|
}
|
|
210
211
|
// HANDLERS
|
|
211
212
|
const handleEdit = () => {
|
|
@@ -219,37 +220,19 @@ function UserProfile(inProps) {
|
|
|
219
220
|
if (privateMessagingEnabled && !isMe && user && user.can_send_pm_to) {
|
|
220
221
|
actionItems = [
|
|
221
222
|
{
|
|
222
|
-
label:
|
|
223
|
+
label: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "templates.userProfile.send.pm", id: "templates.userProfile.send.pm" }),
|
|
223
224
|
to: scRoutingContext.url(react_core_1.SCRoutes.USER_PRIVATE_MESSAGES_ROUTE_NAME, scUser)
|
|
224
225
|
}
|
|
225
226
|
];
|
|
226
227
|
}
|
|
227
|
-
return (
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
scUserContext.user === undefined ||
|
|
237
|
-
(scUserContext.user && ((loadingBlockedBy && blockedBy === null) || scUserContext.managers.blockedUsers.isLoading())) ? (react_1.default.createElement(Skeleton_2.default, null)) : (react_1.default.createElement(react_1.default.Fragment, null, loadingBlockedBy || (scUserContext.user && scUserContext.managers.blockedUsers.loading) ? null : (react_1.default.createElement(react_1.default.Fragment, null, !isMe && scUser && Boolean((scUserContext.user && scUserContext.managers.blockedUsers.isBlocked(scUser)) || blockedBy) ? (react_1.default.createElement(react_ui_1.UserProfileBlocked, { user: scUser, blockedByUser: blockedBy })) : (react_1.default.createElement(react_1.default.Fragment, null,
|
|
238
|
-
react_1.default.createElement(react_ui_1.UserCounters, { className: classes.counters, userId: userId, user: scUser }),
|
|
239
|
-
scUser.date_joined && (react_1.default.createElement(material_1.Typography, { className: classes.info },
|
|
240
|
-
react_1.default.createElement(react_intl_1.FormattedMessage, { id: "templates.userProfile.dateJoined", defaultMessage: "templates.userProfile.dateJoined", values: {
|
|
241
|
-
date: intl.formatDate(scUser.date_joined, {
|
|
242
|
-
year: 'numeric',
|
|
243
|
-
month: 'long'
|
|
244
|
-
})
|
|
245
|
-
} }))),
|
|
246
|
-
scUser.location && (react_1.default.createElement(material_1.Typography, { className: classes.info },
|
|
247
|
-
react_1.default.createElement(material_1.Icon, null, "add_location_alt"),
|
|
248
|
-
" ",
|
|
249
|
-
scUser.location)),
|
|
250
|
-
taggingEnabled && (react_1.default.createElement(material_1.Stack, { key: `tags_${scUser.id}`, direction: "row", spacing: 2, className: classes.tags }, scUser.tags
|
|
251
|
-
.filter((t) => t.visible)
|
|
252
|
-
.map((tag) => (react_1.default.createElement(react_ui_1.TagChip, { key: tag.id, tag: tag, clickable: false, disposable: false }))))),
|
|
253
|
-
react_1.default.createElement(UserFeed_1.default, Object.assign({ key: `feed_${scUser.id}`, className: classes.feed, user: scUser, widgets: _widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, UserFeedProps))))))))));
|
|
228
|
+
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.UserProfileHeader, Object.assign({ user: scUser }, UserProfileHeaderProps, { actions: !isMe && scUser && Boolean((scUserContext.user && scUserContext.managers.blockedUsers.isBlocked(scUser)) || blockedBy) ? null : ((0, jsx_runtime_1.jsxs)(material_1.Stack, Object.assign({ direction: "row", spacing: 2, className: classes.actions }, { children: [startActions, isMe ? editStartActions : viewStartActions, isMe ? ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", color: "secondary", onClick: handleEdit }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { defaultMessage: "templates.userProfile.edit", id: "templates.userProfile.edit" }) }))) : ((0, jsx_runtime_1.jsx)(react_ui_1.ConnectionUserButton, { user: scUser })), isMe ? editEndActions : viewEndActions, endActions, (0, jsx_runtime_1.jsx)(react_ui_1.UserActionIconButton, { user: scUser, items: actionItems })] }), `actions_${scUser.id}`)) })), scUserContext.user === undefined ||
|
|
229
|
+
(scUserContext.user && ((loadingBlockedBy && blockedBy === null) || scUserContext.managers.blockedUsers.isLoading())) ? ((0, jsx_runtime_1.jsx)(Skeleton_2.default, {})) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: loadingBlockedBy || (scUserContext.user && scUserContext.managers.blockedUsers.loading) ? null : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: !isMe && scUser && Boolean((scUserContext.user && scUserContext.managers.blockedUsers.isBlocked(scUser)) || blockedBy) ? ((0, jsx_runtime_1.jsx)(react_ui_1.UserProfileBlocked, { user: scUser, blockedByUser: blockedBy })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(react_ui_1.UserCounters, { className: classes.counters, userId: userId, user: scUser }), scUser.date_joined && ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ className: classes.info }, { children: (0, jsx_runtime_1.jsx)(react_intl_1.FormattedMessage, { id: "templates.userProfile.dateJoined", defaultMessage: "templates.userProfile.dateJoined", values: {
|
|
230
|
+
date: intl.formatDate(scUser.date_joined, {
|
|
231
|
+
year: 'numeric',
|
|
232
|
+
month: 'long'
|
|
233
|
+
})
|
|
234
|
+
} }) }))), scUser.location && ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ className: classes.info }, { children: [(0, jsx_runtime_1.jsx)(material_1.Icon, { children: "add_location_alt" }), " ", scUser.location] }))), taggingEnabled && ((0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ direction: "row", spacing: 2, className: classes.tags }, { children: scUser.tags
|
|
235
|
+
.filter((t) => t.visible)
|
|
236
|
+
.map((tag) => ((0, jsx_runtime_1.jsx)(react_ui_1.TagChip, { tag: tag, clickable: false, disposable: false }, tag.id))) }), `tags_${scUser.id}`)), (0, jsx_runtime_1.jsx)(UserFeed_1.default, Object.assign({ className: classes.feed, user: scUser, widgets: _widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, UserFeedProps), `feed_${scUser.id}`)] })) })) }))] })));
|
|
254
237
|
}
|
|
255
238
|
exports.default = UserProfile;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
4
|
import { CategoryHeader } from '@selfcommunity/react-ui';
|
|
@@ -52,9 +52,7 @@ export default function Category(inProps) {
|
|
|
52
52
|
// Hooks
|
|
53
53
|
const { scCategory } = useSCFetchCategory({ id: categoryId, category });
|
|
54
54
|
if (!scCategory) {
|
|
55
|
-
return
|
|
55
|
+
return _jsx(CategorySkeleton, {});
|
|
56
56
|
}
|
|
57
|
-
return (
|
|
58
|
-
React.createElement(CategoryHeader, { category: scCategory }),
|
|
59
|
-
React.createElement(CategoryFeed, Object.assign({ className: classes.feed, category: scCategory, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, CategoryFeedProps))));
|
|
57
|
+
return (_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, { children: [_jsx(CategoryHeader, { category: scCategory }), _jsx(CategoryFeed, Object.assign({ className: classes.feed, category: scCategory, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, CategoryFeedProps))] })));
|
|
60
58
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import CategoryFeedSkeleton from '../CategoryFeed/Skeleton';
|
|
@@ -32,7 +32,5 @@ const Root = styled(Box, {
|
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
34
|
export default function CategorySkeleton() {
|
|
35
|
-
return (
|
|
36
|
-
React.createElement(CategoryHeaderSkeleton, null),
|
|
37
|
-
React.createElement(CategoryFeedSkeleton, null)));
|
|
35
|
+
return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [_jsx(CategoryHeaderSkeleton, {}), _jsx(CategoryFeedSkeleton, {})] })));
|
|
38
36
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useRef } from 'react';
|
|
2
3
|
import { styled } from '@mui/material/styles';
|
|
3
4
|
import { CategoryTrendingFeedWidget, CategoryTrendingUsersWidget, ContributionUtils, Feed, FeedObject, FeedObjectSkeleton, InlineComposerWidget, SCFeedObjectTemplateType } from '@selfcommunity/react-ui';
|
|
4
5
|
import { Endpoints } from '@selfcommunity/api-services';
|
|
@@ -77,9 +78,8 @@ export default function CategoryFeed(inProps) {
|
|
|
77
78
|
const handleComposerSuccess = (feedObject) => {
|
|
78
79
|
// Not insert if the category does not match
|
|
79
80
|
if (feedObject.categories.findIndex((c) => c.id === scCategory.id) === -1) {
|
|
80
|
-
enqueueSnackbar(
|
|
81
|
-
action: (snackbarId) => (
|
|
82
|
-
React.createElement(FormattedMessage, { id: "ui.composerIconButton.composer.viewContribute", defaultMessage: "ui.composerIconButton.composer.viewContribute" }))),
|
|
81
|
+
enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.composerIconButton.composer.success", defaultMessage: "ui.composerIconButton.composer.success" }), {
|
|
82
|
+
action: (snackbarId) => (_jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes[`${feedObject.type.toUpperCase()}_ROUTE_NAME`], ContributionUtils.getRouteData(feedObject)) }, { children: _jsx(FormattedMessage, { id: "ui.composerIconButton.composer.viewContribute", defaultMessage: "ui.composerIconButton.composer.viewContribute" }) }))),
|
|
83
83
|
variant: 'success',
|
|
84
84
|
autoHideDuration: 7000
|
|
85
85
|
});
|
|
@@ -102,16 +102,16 @@ export default function CategoryFeed(inProps) {
|
|
|
102
102
|
return w;
|
|
103
103
|
}), [widgets, scCategory]);
|
|
104
104
|
if (!scCategory) {
|
|
105
|
-
return
|
|
105
|
+
return _jsx(CategoryFeedSkeleton, {});
|
|
106
106
|
}
|
|
107
|
-
return (
|
|
107
|
+
return (_jsx(Root, Object.assign({ id: id, className: classNames(classes.root, className), ref: feedRef, endpoint: Object.assign(Object.assign({}, Endpoints.CategoryFeed), { url: () => Endpoints.CategoryFeed.url({ id: scCategory.id }) }), widgets: _widgets, ItemComponent: FeedObject, itemPropsGenerator: (scUser, item) => ({
|
|
108
108
|
feedObject: item[item.type],
|
|
109
109
|
feedObjectType: item.type,
|
|
110
110
|
feedObjectActivities: item.activities ? item.activities : null,
|
|
111
111
|
markRead: scUser ? !item.seen_by_id.includes(scUser.id) : null
|
|
112
112
|
}), itemIdGenerator: (item) => item[item.type].id, ItemProps: FeedObjectProps, ItemSkeleton: FeedObjectSkeleton, ItemSkeletonProps: {
|
|
113
113
|
template: SCFeedObjectTemplateType.PREVIEW
|
|
114
|
-
}, FeedSidebarProps: FeedSidebarProps, HeaderComponent:
|
|
114
|
+
}, FeedSidebarProps: FeedSidebarProps, HeaderComponent: _jsx(InlineComposerWidget, { onSuccess: handleComposerSuccess, defaultValue: { categories: [scCategory] }, feedType: SCFeedTypologyType.CATEGORY }), CustomAdvProps: { categoriesId: [scCategory.id] }, enabledCustomAdvPositions: [
|
|
115
115
|
SCCustomAdvPosition.POSITION_FEED_SIDEBAR,
|
|
116
116
|
SCCustomAdvPosition.POSITION_FEED,
|
|
117
117
|
SCCustomAdvPosition.POSITION_BELOW_TOPBAR
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { styled } from '@mui/material/styles';
|
|
3
4
|
import { FeedObjectSkeleton, SCFeedObjectTemplateType, FeedSkeleton, GenericSkeleton, InlineComposerWidgetSkeleton } from '@selfcommunity/react-ui';
|
|
@@ -30,9 +31,5 @@ const Root = styled(FeedSkeleton, {
|
|
|
30
31
|
*
|
|
31
32
|
*/
|
|
32
33
|
export default function CategoryFeedSkeleton() {
|
|
33
|
-
return (
|
|
34
|
-
React.createElement(GenericSkeleton, { sx: { mb: 2 } }),
|
|
35
|
-
React.createElement(GenericSkeleton, { sx: { mb: 2 } })) },
|
|
36
|
-
React.createElement(InlineComposerWidgetSkeleton, null),
|
|
37
|
-
Array.from({ length: 5 }).map((e, i) => (React.createElement(FeedObjectSkeleton, { key: i, template: SCFeedObjectTemplateType.DETAIL })))));
|
|
34
|
+
return (_jsxs(Root, Object.assign({ className: classes.root, sidebar: _jsxs(React.Fragment, { children: [_jsx(GenericSkeleton, { sx: { mb: 2 } }), _jsx(GenericSkeleton, { sx: { mb: 2 } })] }) }, { children: [_jsx(InlineComposerWidgetSkeleton, {}), Array.from({ length: 5 }).map((e, i) => (_jsx(FeedObjectSkeleton, { template: SCFeedObjectTemplateType.DETAIL }, i)))] })));
|
|
38
35
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
3
|
import { Box } from '@mui/material';
|
|
4
4
|
import { EventHeader } from '@selfcommunity/react-ui';
|
|
@@ -55,9 +55,7 @@ export default function Event(inProps) {
|
|
|
55
55
|
setSCEvent(Object.assign({}, scEvent, { subscription_status: status }));
|
|
56
56
|
};
|
|
57
57
|
if (!scEvent) {
|
|
58
|
-
return
|
|
58
|
+
return _jsx(EventSkeletonTemplate, {});
|
|
59
59
|
}
|
|
60
|
-
return (
|
|
61
|
-
React.createElement(EventHeader, { eventId: scEvent.id, GroupSubscribeButtonProps: { onSubscribe: handleSubscribe } }),
|
|
62
|
-
React.createElement(EventFeed, Object.assign({ className: classes.feed, event: scEvent, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, EventFeedProps))));
|
|
60
|
+
return (_jsxs(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, { children: [_jsx(EventHeader, { eventId: scEvent.id, GroupSubscribeButtonProps: { onSubscribe: handleSubscribe } }), _jsx(EventFeed, Object.assign({ className: classes.feed, event: scEvent, widgets: widgets, FeedObjectProps: FeedObjectProps, FeedSidebarProps: FeedSidebarProps }, EventFeedProps))] })));
|
|
63
61
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
3
|
import { styled } from '@mui/material/styles';
|
|
4
4
|
import EventFeedSkeleton from '../EventFeed/Skeleton';
|
|
@@ -32,7 +32,5 @@ const Root = styled(Box, {
|
|
|
32
32
|
*
|
|
33
33
|
*/
|
|
34
34
|
export default function EventSkeletonTemplate() {
|
|
35
|
-
return (
|
|
36
|
-
React.createElement(EventHeaderSkeleton, null),
|
|
37
|
-
React.createElement(EventFeedSkeleton, null)));
|
|
35
|
+
return (_jsxs(Root, Object.assign({ className: classes.root }, { children: [_jsx(EventHeaderSkeleton, {}), _jsx(EventFeedSkeleton, {})] })));
|
|
38
36
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useRef } from 'react';
|
|
2
3
|
import { styled } from '@mui/material/styles';
|
|
3
4
|
import { ContributionUtils, EventInfoWidget, EventLocationWidget, Feed, FeedObject, FeedObjectSkeleton, InlineComposerWidget, SCFeedObjectTemplateType } from '@selfcommunity/react-ui';
|
|
4
5
|
import { Endpoints } from '@selfcommunity/api-services';
|
|
@@ -68,9 +69,8 @@ export default function EventFeed(inProps) {
|
|
|
68
69
|
// HANDLERS
|
|
69
70
|
const handleComposerSuccess = (feedObject) => {
|
|
70
71
|
var _a;
|
|
71
|
-
enqueueSnackbar(
|
|
72
|
-
action: (snackbarId) => (
|
|
73
|
-
React.createElement(FormattedMessage, { id: "ui.composerIconButton.composer.viewContribute", defaultMessage: "ui.composerIconButton.composer.viewContribute" }))),
|
|
72
|
+
enqueueSnackbar(_jsx(FormattedMessage, { id: "ui.composerIconButton.composer.success", defaultMessage: "ui.composerIconButton.composer.success" }), {
|
|
73
|
+
action: (snackbarId) => (_jsx(Link, Object.assign({ to: scRoutingContext.url(SCRoutes[`${feedObject.type.toUpperCase()}_ROUTE_NAME`], ContributionUtils.getRouteData(feedObject)) }, { children: _jsx(FormattedMessage, { id: "ui.composerIconButton.composer.viewContribute", defaultMessage: "ui.composerIconButton.composer.viewContribute" }) }))),
|
|
74
74
|
variant: 'success',
|
|
75
75
|
autoHideDuration: 7000
|
|
76
76
|
});
|
|
@@ -93,15 +93,15 @@ export default function EventFeed(inProps) {
|
|
|
93
93
|
return w;
|
|
94
94
|
}), [widgets, scEvent]);
|
|
95
95
|
if (!scEvent) {
|
|
96
|
-
return
|
|
96
|
+
return _jsx(EventFeedSkeleton, {});
|
|
97
97
|
}
|
|
98
98
|
else if (scEvent &&
|
|
99
99
|
scEvent.subscription_status !== SCEventSubscriptionStatusType.SUBSCRIBED &&
|
|
100
100
|
scEvent.subscription_status !== SCEventSubscriptionStatusType.GOING &&
|
|
101
101
|
scEvent.subscription_status !== SCEventSubscriptionStatusType.NOT_GOING) {
|
|
102
|
-
return
|
|
102
|
+
return _jsx(EventInfoWidget, { className: classes.root, event: scEvent });
|
|
103
103
|
}
|
|
104
|
-
return (
|
|
104
|
+
return (_jsx(Root, Object.assign({ className: classNames(classes.root, className), id: id, ref: feedRef, endpoint: Object.assign(Object.assign({}, Endpoints.GetEventFeed), { url: () => Endpoints.GetEventFeed.url({ id: scEvent.id }) }), widgets: _widgets, ItemComponent: FeedObject, itemPropsGenerator: (scUser, item) => {
|
|
105
105
|
var _a;
|
|
106
106
|
return ({
|
|
107
107
|
feedObject: item[item.type],
|
|
@@ -111,11 +111,9 @@ export default function EventFeed(inProps) {
|
|
|
111
111
|
});
|
|
112
112
|
}, itemIdGenerator: (item) => item[item.type].id, ItemProps: FeedObjectProps, ItemSkeleton: FeedObjectSkeleton, ItemSkeletonProps: {
|
|
113
113
|
template: SCFeedObjectTemplateType.PREVIEW
|
|
114
|
-
}, FeedSidebarProps: FeedSidebarProps, HeaderComponent:
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
// defaultValue={{event: scEvent}}
|
|
118
|
-
label: React.createElement(FormattedMessage, { id: "templates.eventFeed.composer.label", defaultMessage: "templates.eventFeed.composer.label" }), feedType: SCFeedTypologyType.EVENT }))), CustomAdvProps: { position: SCCustomAdvPosition.POSITION_FEED, groupsId: [scEvent.id] }, enabledCustomAdvPositions: [
|
|
114
|
+
}, FeedSidebarProps: FeedSidebarProps, HeaderComponent: _jsxs(_Fragment, { children: [_jsx(EventInfoWidget, { className: classes.root, event: scEvent }), scEvent && scEvent.subscription_status === SCEventSubscriptionStatusType.SUBSCRIBED && (_jsx(InlineComposerWidget, { onSuccess: handleComposerSuccess,
|
|
115
|
+
// defaultValue={{event: scEvent}}
|
|
116
|
+
label: _jsx(FormattedMessage, { id: "templates.eventFeed.composer.label", defaultMessage: "templates.eventFeed.composer.label" }), feedType: SCFeedTypologyType.EVENT }))] }), CustomAdvProps: { position: SCCustomAdvPosition.POSITION_FEED, groupsId: [scEvent.id] }, enabledCustomAdvPositions: [
|
|
119
117
|
SCCustomAdvPosition.POSITION_FEED_SIDEBAR,
|
|
120
118
|
SCCustomAdvPosition.POSITION_FEED,
|
|
121
119
|
SCCustomAdvPosition.POSITION_BELOW_TOPBAR
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { styled } from '@mui/material/styles';
|
|
3
4
|
import { FeedObjectSkeleton, SCFeedObjectTemplateType, FeedSkeleton, GenericSkeleton, InlineComposerWidgetSkeleton } from '@selfcommunity/react-ui';
|
|
@@ -30,9 +31,5 @@ const Root = styled(FeedSkeleton, {
|
|
|
30
31
|
*
|
|
31
32
|
*/
|
|
32
33
|
export default function EventFeedSkeleton() {
|
|
33
|
-
return (
|
|
34
|
-
React.createElement(GenericSkeleton, { sx: { mb: 2 } }),
|
|
35
|
-
React.createElement(GenericSkeleton, { sx: { mb: 2 } })) },
|
|
36
|
-
React.createElement(InlineComposerWidgetSkeleton, null),
|
|
37
|
-
Array.from({ length: 5 }).map((e, i) => (React.createElement(FeedObjectSkeleton, { key: i, template: SCFeedObjectTemplateType.DETAIL })))));
|
|
34
|
+
return (_jsxs(Root, Object.assign({ className: classes.root, sidebar: _jsxs(React.Fragment, { children: [_jsx(GenericSkeleton, { sx: { mb: 2 } }), _jsx(GenericSkeleton, { sx: { mb: 2 } })] }) }, { children: [_jsx(InlineComposerWidgetSkeleton, {}), Array.from({ length: 5 }).map((e, i) => (_jsx(FeedObjectSkeleton, { template: SCFeedObjectTemplateType.DETAIL }, i)))] })));
|
|
38
35
|
}
|