@selfcommunity/react-ui 0.7.0-alpha.79 → 0.7.0-alpha.80
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/FeedObject/FeedObject.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/FeedObject.js +0 -1
- package/lib/cjs/components/FeedObject/FeedObject.js.map +1 -1
- package/lib/cjs/components/FeedUpdates/FeedUpdates.d.ts.map +1 -1
- package/lib/cjs/components/FeedUpdates/FeedUpdates.js +0 -1
- package/lib/cjs/components/FeedUpdates/FeedUpdates.js.map +1 -1
- package/lib/cjs/components/NavigationToolbar/NotificationMenu.d.ts.map +1 -1
- package/lib/cjs/components/NavigationToolbar/NotificationMenu.js +5 -2
- package/lib/cjs/components/NavigationToolbar/NotificationMenu.js.map +1 -1
- package/lib/cjs/components/Notification/CollapsedFor/CollapsedFor.d.ts +2 -21
- package/lib/cjs/components/Notification/CollapsedFor/CollapsedFor.d.ts.map +1 -1
- package/lib/cjs/components/Notification/CollapsedFor/CollapsedFor.js +15 -16
- package/lib/cjs/components/Notification/CollapsedFor/CollapsedFor.js.map +1 -1
- package/lib/cjs/components/Notification/Comment/Comment.d.ts +2 -21
- package/lib/cjs/components/Notification/Comment/Comment.d.ts.map +1 -1
- package/lib/cjs/components/Notification/Comment/Comment.js +23 -24
- package/lib/cjs/components/Notification/Comment/Comment.js.map +1 -1
- package/lib/cjs/components/Notification/Contribution/Contribution.d.ts +2 -21
- package/lib/cjs/components/Notification/Contribution/Contribution.d.ts.map +1 -1
- package/lib/cjs/components/Notification/Contribution/Contribution.js +25 -25
- package/lib/cjs/components/Notification/Contribution/Contribution.js.map +1 -1
- package/lib/cjs/components/Notification/ContributionFollow/ContributionFollow.d.ts +2 -21
- package/lib/cjs/components/Notification/ContributionFollow/ContributionFollow.d.ts.map +1 -1
- package/lib/cjs/components/Notification/ContributionFollow/ContributionFollow.js +18 -19
- package/lib/cjs/components/Notification/ContributionFollow/ContributionFollow.js.map +1 -1
- package/lib/cjs/components/Notification/DeletedFor/DeletedFor.d.ts +2 -21
- package/lib/cjs/components/Notification/DeletedFor/DeletedFor.d.ts.map +1 -1
- package/lib/cjs/components/Notification/DeletedFor/DeletedFor.js +17 -18
- package/lib/cjs/components/Notification/DeletedFor/DeletedFor.js.map +1 -1
- package/lib/cjs/components/Notification/IncubatorApproved/IncubatorApproved.d.ts +2 -21
- package/lib/cjs/components/Notification/IncubatorApproved/IncubatorApproved.d.ts.map +1 -1
- package/lib/cjs/components/Notification/IncubatorApproved/IncubatorApproved.js +16 -19
- package/lib/cjs/components/Notification/IncubatorApproved/IncubatorApproved.js.map +1 -1
- package/lib/cjs/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.d.ts +2 -21
- package/lib/cjs/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.d.ts.map +1 -1
- package/lib/cjs/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.js +9 -10
- package/lib/cjs/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.js.map +1 -1
- package/lib/cjs/components/Notification/KindlyNoticeFor/KindlyNoticeFor.d.ts +2 -21
- package/lib/cjs/components/Notification/KindlyNoticeFor/KindlyNoticeFor.d.ts.map +1 -1
- package/lib/cjs/components/Notification/KindlyNoticeFor/KindlyNoticeFor.js +16 -17
- package/lib/cjs/components/Notification/KindlyNoticeFor/KindlyNoticeFor.js.map +1 -1
- package/lib/cjs/components/Notification/Mention/Mention.d.ts +2 -21
- package/lib/cjs/components/Notification/Mention/Mention.d.ts.map +1 -1
- package/lib/cjs/components/Notification/Mention/Mention.js +18 -19
- package/lib/cjs/components/Notification/Mention/Mention.js.map +1 -1
- package/lib/cjs/components/Notification/Notification.d.ts +12 -12
- package/lib/cjs/components/Notification/Notification.d.ts.map +1 -1
- package/lib/cjs/components/Notification/Notification.js +33 -86
- package/lib/cjs/components/Notification/Notification.js.map +1 -1
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.d.ts +2 -21
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.d.ts.map +1 -1
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js +11 -20
- package/lib/cjs/components/Notification/PrivateMessage/PrivateMessage.js.map +1 -1
- package/lib/cjs/components/Notification/UndeletedFor/UndeletedFor.d.ts +2 -21
- package/lib/cjs/components/Notification/UndeletedFor/UndeletedFor.d.ts.map +1 -1
- package/lib/cjs/components/Notification/UndeletedFor/UndeletedFor.js +16 -17
- package/lib/cjs/components/Notification/UndeletedFor/UndeletedFor.js.map +1 -1
- package/lib/cjs/components/Notification/UserBlocked/UserBlocked.d.ts +2 -21
- package/lib/cjs/components/Notification/UserBlocked/UserBlocked.d.ts.map +1 -1
- package/lib/cjs/components/Notification/UserBlocked/UserBlocked.js +10 -11
- package/lib/cjs/components/Notification/UserBlocked/UserBlocked.js.map +1 -1
- package/lib/cjs/components/Notification/UserConnection/UserConnection.d.ts +2 -21
- package/lib/cjs/components/Notification/UserConnection/UserConnection.d.ts.map +1 -1
- package/lib/cjs/components/Notification/UserConnection/UserConnection.js +12 -13
- package/lib/cjs/components/Notification/UserConnection/UserConnection.js.map +1 -1
- package/lib/cjs/components/Notification/UserFollow/UserFollow.d.ts +2 -21
- package/lib/cjs/components/Notification/UserFollow/UserFollow.d.ts.map +1 -1
- package/lib/cjs/components/Notification/UserFollow/UserFollow.js +10 -11
- package/lib/cjs/components/Notification/UserFollow/UserFollow.js.map +1 -1
- package/lib/cjs/components/Notification/VoteUp/VoteUp.d.ts +2 -21
- package/lib/cjs/components/Notification/VoteUp/VoteUp.d.ts.map +1 -1
- package/lib/cjs/components/Notification/VoteUp/VoteUp.js +16 -17
- package/lib/cjs/components/Notification/VoteUp/VoteUp.js.map +1 -1
- package/lib/cjs/components/SnippetNotifications/Skeleton.d.ts +1 -1
- package/lib/cjs/components/SnippetNotifications/Skeleton.d.ts.map +1 -1
- package/lib/cjs/components/SnippetNotifications/Skeleton.js +5 -12
- package/lib/cjs/components/SnippetNotifications/Skeleton.js.map +1 -1
- package/lib/cjs/components/SnippetNotifications/SnippetNotifications.d.ts +2 -2
- package/lib/cjs/components/SnippetNotifications/SnippetNotifications.d.ts.map +1 -1
- package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js +7 -21
- package/lib/cjs/components/SnippetNotifications/SnippetNotifications.js.map +1 -1
- package/lib/cjs/shared/CustomSnackMessage/index.d.ts.map +1 -1
- package/lib/cjs/shared/CustomSnackMessage/index.js +5 -19
- package/lib/cjs/shared/CustomSnackMessage/index.js.map +1 -1
- package/lib/cjs/shared/NotificationItem/NotificationItem.d.ts +1 -6
- package/lib/cjs/shared/NotificationItem/NotificationItem.d.ts.map +1 -1
- package/lib/cjs/shared/NotificationItem/NotificationItem.js +13 -123
- package/lib/cjs/shared/NotificationItem/NotificationItem.js.map +1 -1
- package/lib/esm/components/FeedObject/FeedObject.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/FeedObject.js +0 -1
- package/lib/esm/components/FeedObject/FeedObject.js.map +1 -1
- package/lib/esm/components/FeedUpdates/FeedUpdates.d.ts.map +1 -1
- package/lib/esm/components/FeedUpdates/FeedUpdates.js +0 -1
- package/lib/esm/components/FeedUpdates/FeedUpdates.js.map +1 -1
- package/lib/esm/components/NavigationToolbar/NotificationMenu.d.ts.map +1 -1
- package/lib/esm/components/NavigationToolbar/NotificationMenu.js +6 -3
- package/lib/esm/components/NavigationToolbar/NotificationMenu.js.map +1 -1
- package/lib/esm/components/Notification/CollapsedFor/CollapsedFor.d.ts +2 -21
- package/lib/esm/components/Notification/CollapsedFor/CollapsedFor.d.ts.map +1 -1
- package/lib/esm/components/Notification/CollapsedFor/CollapsedFor.js +15 -16
- package/lib/esm/components/Notification/CollapsedFor/CollapsedFor.js.map +1 -1
- package/lib/esm/components/Notification/Comment/Comment.d.ts +2 -21
- package/lib/esm/components/Notification/Comment/Comment.d.ts.map +1 -1
- package/lib/esm/components/Notification/Comment/Comment.js +24 -25
- package/lib/esm/components/Notification/Comment/Comment.js.map +1 -1
- package/lib/esm/components/Notification/Contribution/Contribution.d.ts +2 -21
- package/lib/esm/components/Notification/Contribution/Contribution.d.ts.map +1 -1
- package/lib/esm/components/Notification/Contribution/Contribution.js +26 -26
- package/lib/esm/components/Notification/Contribution/Contribution.js.map +1 -1
- package/lib/esm/components/Notification/ContributionFollow/ContributionFollow.d.ts +2 -21
- package/lib/esm/components/Notification/ContributionFollow/ContributionFollow.d.ts.map +1 -1
- package/lib/esm/components/Notification/ContributionFollow/ContributionFollow.js +19 -20
- package/lib/esm/components/Notification/ContributionFollow/ContributionFollow.js.map +1 -1
- package/lib/esm/components/Notification/DeletedFor/DeletedFor.d.ts +2 -21
- package/lib/esm/components/Notification/DeletedFor/DeletedFor.d.ts.map +1 -1
- package/lib/esm/components/Notification/DeletedFor/DeletedFor.js +17 -18
- package/lib/esm/components/Notification/DeletedFor/DeletedFor.js.map +1 -1
- package/lib/esm/components/Notification/IncubatorApproved/IncubatorApproved.d.ts +2 -21
- package/lib/esm/components/Notification/IncubatorApproved/IncubatorApproved.d.ts.map +1 -1
- package/lib/esm/components/Notification/IncubatorApproved/IncubatorApproved.js +17 -20
- package/lib/esm/components/Notification/IncubatorApproved/IncubatorApproved.js.map +1 -1
- package/lib/esm/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.d.ts +2 -21
- package/lib/esm/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.d.ts.map +1 -1
- package/lib/esm/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.js +9 -10
- package/lib/esm/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.js.map +1 -1
- package/lib/esm/components/Notification/KindlyNoticeFor/KindlyNoticeFor.d.ts +2 -21
- package/lib/esm/components/Notification/KindlyNoticeFor/KindlyNoticeFor.d.ts.map +1 -1
- package/lib/esm/components/Notification/KindlyNoticeFor/KindlyNoticeFor.js +16 -17
- package/lib/esm/components/Notification/KindlyNoticeFor/KindlyNoticeFor.js.map +1 -1
- package/lib/esm/components/Notification/Mention/Mention.d.ts +2 -21
- package/lib/esm/components/Notification/Mention/Mention.d.ts.map +1 -1
- package/lib/esm/components/Notification/Mention/Mention.js +18 -19
- package/lib/esm/components/Notification/Mention/Mention.js.map +1 -1
- package/lib/esm/components/Notification/Notification.d.ts +12 -12
- package/lib/esm/components/Notification/Notification.d.ts.map +1 -1
- package/lib/esm/components/Notification/Notification.js +35 -88
- package/lib/esm/components/Notification/Notification.js.map +1 -1
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.d.ts +2 -21
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.d.ts.map +1 -1
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js +11 -20
- package/lib/esm/components/Notification/PrivateMessage/PrivateMessage.js.map +1 -1
- package/lib/esm/components/Notification/UndeletedFor/UndeletedFor.d.ts +2 -21
- package/lib/esm/components/Notification/UndeletedFor/UndeletedFor.d.ts.map +1 -1
- package/lib/esm/components/Notification/UndeletedFor/UndeletedFor.js +17 -18
- package/lib/esm/components/Notification/UndeletedFor/UndeletedFor.js.map +1 -1
- package/lib/esm/components/Notification/UserBlocked/UserBlocked.d.ts +2 -21
- package/lib/esm/components/Notification/UserBlocked/UserBlocked.d.ts.map +1 -1
- package/lib/esm/components/Notification/UserBlocked/UserBlocked.js +11 -12
- package/lib/esm/components/Notification/UserBlocked/UserBlocked.js.map +1 -1
- package/lib/esm/components/Notification/UserConnection/UserConnection.d.ts +2 -21
- package/lib/esm/components/Notification/UserConnection/UserConnection.d.ts.map +1 -1
- package/lib/esm/components/Notification/UserConnection/UserConnection.js +13 -14
- package/lib/esm/components/Notification/UserConnection/UserConnection.js.map +1 -1
- package/lib/esm/components/Notification/UserFollow/UserFollow.d.ts +2 -21
- package/lib/esm/components/Notification/UserFollow/UserFollow.d.ts.map +1 -1
- package/lib/esm/components/Notification/UserFollow/UserFollow.js +11 -12
- package/lib/esm/components/Notification/UserFollow/UserFollow.js.map +1 -1
- package/lib/esm/components/Notification/VoteUp/VoteUp.d.ts +2 -21
- package/lib/esm/components/Notification/VoteUp/VoteUp.d.ts.map +1 -1
- package/lib/esm/components/Notification/VoteUp/VoteUp.js +17 -18
- package/lib/esm/components/Notification/VoteUp/VoteUp.js.map +1 -1
- package/lib/esm/components/SnippetNotifications/Skeleton.d.ts +1 -1
- package/lib/esm/components/SnippetNotifications/Skeleton.d.ts.map +1 -1
- package/lib/esm/components/SnippetNotifications/Skeleton.js +6 -13
- package/lib/esm/components/SnippetNotifications/Skeleton.js.map +1 -1
- package/lib/esm/components/SnippetNotifications/SnippetNotifications.d.ts +2 -2
- package/lib/esm/components/SnippetNotifications/SnippetNotifications.d.ts.map +1 -1
- package/lib/esm/components/SnippetNotifications/SnippetNotifications.js +7 -21
- package/lib/esm/components/SnippetNotifications/SnippetNotifications.js.map +1 -1
- package/lib/esm/shared/CustomSnackMessage/index.d.ts.map +1 -1
- package/lib/esm/shared/CustomSnackMessage/index.js +5 -19
- package/lib/esm/shared/CustomSnackMessage/index.js.map +1 -1
- package/lib/esm/shared/NotificationItem/NotificationItem.d.ts +1 -6
- package/lib/esm/shared/NotificationItem/NotificationItem.d.ts.map +1 -1
- package/lib/esm/shared/NotificationItem/NotificationItem.js +13 -123
- package/lib/esm/shared/NotificationItem/NotificationItem.js.map +1 -1
- package/lib/umd/react-ui.js +3 -3
- package/lib/umd/react-ui.js.LICENSE.txt +2 -2
- package/lib/umd/react-ui.js.map +1 -1
- package/package.json +3 -3
|
@@ -39,7 +39,7 @@ const classes = {
|
|
|
39
39
|
contributionYouWroteLabel: `${PREFIX}-contribution-you-wrote-label`,
|
|
40
40
|
contributionText: `${PREFIX}-contribution-text`
|
|
41
41
|
};
|
|
42
|
-
const Root = styled(
|
|
42
|
+
const Root = styled(NotificationItem, {
|
|
43
43
|
name: PREFIX,
|
|
44
44
|
slot: 'Root',
|
|
45
45
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -85,14 +85,13 @@ export default function KindlyNoticeFlagNotification(inProps) {
|
|
|
85
85
|
/**
|
|
86
86
|
* Renders root object
|
|
87
87
|
*/
|
|
88
|
-
return (React.createElement(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`)
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
React.createElement(Typography, { component: "div", color: "inherit", className: classes.flagText },
|
|
92
|
-
|
|
93
|
-
React.createElement(
|
|
94
|
-
|
|
95
|
-
React.createElement(
|
|
96
|
-
React.createElement(Typography, { component: 'span', variant: "body2", gutterBottom: true }, getContributionSnippet(notificationObject[contributionType])))))) })));
|
|
88
|
+
return (React.createElement(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: React.createElement(Avatar, { variant: "circular", classes: { root: classes.flagIcon } },
|
|
89
|
+
React.createElement(Icon, null, "outlined_flag")), primary: React.createElement(React.Fragment, null, isSnippetTemplate ? (React.createElement(Link, { to: scRoutingContext.url(SCRoutes[`${contributionType.toUpperCase()}_ROUTE_NAME`], getRouteData(notificationObject[contributionType])) },
|
|
90
|
+
React.createElement(Typography, { component: "div", color: "inherit", className: classes.flagText },
|
|
91
|
+
React.createElement(FormattedMessage, { id: `ui.notification.kindlyNoticeFlag.kindlyNoticeFlagSnippet`, defaultMessage: `ui.notification.kindlyNoticeFlag.kindlyNoticeFlagSnippet` })))) : (React.createElement(Typography, { component: "div", color: "inherit", className: classes.flagText }, intl.formatMessage(messages[camelCase(notificationObject.type)], { b: (...chunks) => React.createElement("strong", null, chunks) })))), secondary: (template === SCNotificationObjectTemplateType.DETAIL || template === SCNotificationObjectTemplateType.SNIPPET) && (React.createElement(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt })), footer: !isSnippetTemplate && (React.createElement(Box, { className: classes.contributionWrap },
|
|
92
|
+
React.createElement(Typography, { variant: 'body2', color: 'inherit', component: 'div', classes: { root: classes.contributionYouWroteLabel } },
|
|
93
|
+
React.createElement(FormattedMessage, { id: "ui.notification.undeletedFor.youWrote", defaultMessage: "ui.notification.undeletedFor.youWrote" })),
|
|
94
|
+
React.createElement(Link, { to: scRoutingContext.url(SCRoutes[`${contributionType.toUpperCase()}_ROUTE_NAME`], getRouteData(notificationObject[contributionType])), className: classes.contributionText },
|
|
95
|
+
React.createElement(Typography, { component: 'span', variant: "body2" }, getContributionSnippet(notificationObject[contributionType]))))) }, rest)));
|
|
97
96
|
}
|
|
98
97
|
//# sourceMappingURL=KindlyNoticeFlag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KindlyNoticeFlag.js","sourceRoot":"","sources":["../../../../../src/components/Notification/KindlyNoticeFlag/KindlyNoticeFlag.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAE,GAAG,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AACtD,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,IAAI,EAAwB,YAAY,EAAE,QAAQ,EAAC,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AACrE,OAAO,EAAC,mBAAmB,EAAE,sBAAsB,EAAE,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACtG,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,gCAAgC,EAAC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"KindlyNoticeFlag.js","sourceRoot":"","sources":["../../../../../src/components/Notification/KindlyNoticeFlag/KindlyNotic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|
import { SCNotificationDeletedForType } from '@selfcommunity/types';
|
|
2
|
-
import {
|
|
3
|
-
export interface NotificationKindlyNoticeForProps {
|
|
4
|
-
/**
|
|
5
|
-
* Id of the feedObject
|
|
6
|
-
* @default `n_<notificationObject.sid>`
|
|
7
|
-
*/
|
|
8
|
-
id?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Overrides or extends the styles applied to the component.
|
|
11
|
-
* @default null
|
|
12
|
-
*/
|
|
13
|
-
className?: string;
|
|
2
|
+
import { NotificationItemProps } from '../../../shared/NotificationItem';
|
|
3
|
+
export interface NotificationKindlyNoticeForProps extends Pick<NotificationItemProps, Exclude<keyof NotificationItemProps, 'image' | 'disableTypography' | 'primary' | 'primaryTypographyProps' | 'secondary' | 'secondaryTypographyProps' | 'actions' | 'footer' | 'isNew'>> {
|
|
14
4
|
/**
|
|
15
5
|
* Notification obj
|
|
16
6
|
* @default null
|
|
17
7
|
*/
|
|
18
8
|
notificationObject: SCNotificationDeletedForType;
|
|
19
|
-
/**
|
|
20
|
-
* Notification Object template type
|
|
21
|
-
* @default 'detail'
|
|
22
|
-
*/
|
|
23
|
-
template?: SCNotificationObjectTemplateType;
|
|
24
|
-
/**
|
|
25
|
-
* Any other properties
|
|
26
|
-
*/
|
|
27
|
-
[p: string]: any;
|
|
28
9
|
}
|
|
29
10
|
/**
|
|
30
11
|
* This component render the content of the notification of type kindly notice for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KindlyNoticeFor.d.ts","sourceRoot":"","sources":["../../../../../src/components/Notification/KindlyNoticeFor/KindlyNoticeFor.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAC,4BAA4B,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"KindlyNoticeFor.d.ts","sourceRoot":"","sources":["../../../../../src/components/Notification/KindlyNoticeFor/KindlyNoticeFor.tsx"],"names":[],"mappings":"AAMA,OAAO,EAAC,4BAA4B,EAAC,MAAM,sBAAsB,CAAC;AAOlE,OAAyB,EAAC,qBAAqB,EAAC,MAAM,kCAAkC,CAAC;AAoEzF,MAAM,WAAW,gCACf,SAAQ,IAAI,CACV,qBAAqB,EACrB,OAAO,CACL,MAAM,qBAAqB,EAC3B,OAAO,GAAG,mBAAmB,GAAG,SAAS,GAAG,wBAAwB,GAAG,WAAW,GAAG,0BAA0B,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CACjJ,CACF;IACD;;;OAGG;IACH,kBAAkB,EAAE,4BAA4B,CAAC;CAClD;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,2BAA2B,CAAC,OAAO,EAAE,gCAAgC,GAAG,GAAG,CAAC,OAAO,CAuG1G"}
|
|
@@ -59,7 +59,7 @@ const classes = {
|
|
|
59
59
|
contributionYouWroteLabel: `${PREFIX}-contribution-you-wrote-label`,
|
|
60
60
|
contributionText: `${PREFIX}-contribution-text`
|
|
61
61
|
};
|
|
62
|
-
const Root = styled(
|
|
62
|
+
const Root = styled(NotificationItem, {
|
|
63
63
|
name: PREFIX,
|
|
64
64
|
slot: 'Root',
|
|
65
65
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -106,21 +106,20 @@ export default function KindlyNoticeForNotification(inProps) {
|
|
|
106
106
|
/**
|
|
107
107
|
* Renders root object
|
|
108
108
|
*/
|
|
109
|
-
return (React.createElement(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`)
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
React.createElement(Typography, { component: "div", color: "inherit", className: classes.flagText },
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
React.createElement(
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
React.createElement(
|
|
123
|
-
React.createElement(
|
|
124
|
-
React.createElement(FormattedMessage, { id: "ui.userToastNotifications.viewContribution", defaultMessage: 'ui.userToastNotifications.viewContribution' })))))) })));
|
|
109
|
+
return (React.createElement(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: React.createElement(Avatar, { variant: "circular", classes: { root: classes.flagIcon } },
|
|
110
|
+
React.createElement(Icon, null, "outlined_flag")), primary: React.createElement(React.Fragment, null, isSnippetTemplate ? (React.createElement(Link, { to: scRoutingContext.url(SCRoutes[`${contributionType.toUpperCase()}_ROUTE_NAME`], getRouteData(notificationObject[contributionType])) },
|
|
111
|
+
React.createElement(Typography, { component: "div", color: "inherit", className: classes.flagText },
|
|
112
|
+
React.createElement(FormattedMessage, { id: `ui.notification.kindlyNoticeFor.${camelCase(notificationObject.type)}Snippet`, defaultMessage: `ui.notification.kindlyNoticeFor.${camelCase(notificationObject.type)}Snippet` })))) : (React.createElement(Typography, { component: "div", color: "inherit", className: classes.flagText }, intl.formatMessage(messages[camelCase(notificationObject.type)], { b: (...chunks) => React.createElement("strong", null, chunks) })))), secondary: (template === SCNotificationObjectTemplateType.DETAIL || template === SCNotificationObjectTemplateType.SNIPPET) && (React.createElement(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt })), footer: isSnippetTemplate ? null : (React.createElement(React.Fragment, null,
|
|
113
|
+
React.createElement(Box, { className: classes.contributionWrap },
|
|
114
|
+
React.createElement(Typography, { variant: 'body2', color: 'inherit', component: 'div', classes: { root: classes.contributionYouWroteLabel } }, intl.formatMessage(messages.youWrote, {
|
|
115
|
+
b: (...chunks) => React.createElement("strong", null, chunks)
|
|
116
|
+
})),
|
|
117
|
+
React.createElement(Link, { to: scRoutingContext.url(SCRoutes[`${contributionType.toUpperCase()}_ROUTE_NAME`], getRouteData(notificationObject[contributionType])), className: classes.contributionText },
|
|
118
|
+
React.createElement(Typography, { component: 'span', variant: "body2" }, getContributionSnippet(notificationObject[contributionType])))),
|
|
119
|
+
template === SCNotificationObjectTemplateType.TOAST && (React.createElement(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 },
|
|
120
|
+
React.createElement(DateTimeAgo, { date: notificationObject.active_at }),
|
|
121
|
+
React.createElement(Typography, { color: "primary", component: 'div' },
|
|
122
|
+
React.createElement(Link, { to: scRoutingContext.url(SCRoutes[`${notificationObject[contributionType]['type'].toUpperCase()}_ROUTE_NAME`], getRouteData(notificationObject[contributionType])) },
|
|
123
|
+
React.createElement(FormattedMessage, { id: "ui.userToastNotifications.viewContribution", defaultMessage: 'ui.userToastNotifications.viewContribution' }))))))) }, rest)));
|
|
125
124
|
}
|
|
126
125
|
//# sourceMappingURL=KindlyNoticeFor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"KindlyNoticeFor.js","sourceRoot":"","sources":["../../../../../src/components/Notification/KindlyNoticeFor/KindlyNoticeFor.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,IAAI,MAAM,oBAAoB,CAAC;AACtC,OAAO,EAAC,SAAS,EAAC,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAC,IAAI,EAAwB,YAAY,EAAE,QAAQ,EAAC,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AACrE,OAAO,EAAC,mBAAmB,EAAE,sBAAsB,EAAE,YAAY,EAAC,MAAM,6BAA6B,CAAC;AACtG,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,gCAAgC,EAAC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"KindlyNoticeFor.js","sour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,CAAC;AACJ,CAAC"}
|
|
@@ -1,30 +1,11 @@
|
|
|
1
1
|
import { SCNotificationMentionType } from '@selfcommunity/types';
|
|
2
|
-
import {
|
|
3
|
-
export interface MentionNotificationProps {
|
|
4
|
-
/**
|
|
5
|
-
* Id of the feedObject
|
|
6
|
-
* @default `n_<notificationObject.sid>`
|
|
7
|
-
*/
|
|
8
|
-
id?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Overrides or extends the styles applied to the component.
|
|
11
|
-
* @default null
|
|
12
|
-
*/
|
|
13
|
-
className?: string;
|
|
2
|
+
import { NotificationItemProps } from '../../../shared/NotificationItem';
|
|
3
|
+
export interface MentionNotificationProps extends Pick<NotificationItemProps, Exclude<keyof NotificationItemProps, 'image' | 'disableTypography' | 'primary' | 'primaryTypographyProps' | 'secondary' | 'secondaryTypographyProps' | 'actions' | 'footer' | 'isNew'>> {
|
|
14
4
|
/**
|
|
15
5
|
* Notification obj
|
|
16
6
|
* @default null
|
|
17
7
|
*/
|
|
18
8
|
notificationObject: SCNotificationMentionType;
|
|
19
|
-
/**
|
|
20
|
-
* Notification Object template type
|
|
21
|
-
* @default 'detail'
|
|
22
|
-
*/
|
|
23
|
-
template?: SCNotificationObjectTemplateType;
|
|
24
|
-
/**
|
|
25
|
-
* Any other properties
|
|
26
|
-
*/
|
|
27
|
-
[p: string]: any;
|
|
28
9
|
}
|
|
29
10
|
/**
|
|
30
11
|
* This component render the content of the notification of type mention
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mention.d.ts","sourceRoot":"","sources":["../../../../../src/components/Notification/Mention/Mention.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,yBAAyB,EAAC,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"Mention.d.ts","sourceRoot":"","sources":["../../../../../src/components/Notification/Mention/Mention.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAC,yBAAyB,EAAC,MAAM,sBAAsB,CAAC;AAO/D,OAAyB,EAAC,qBAAqB,EAAC,MAAM,kCAAkC,CAAC;AA4CzF,MAAM,WAAW,wBACf,SAAQ,IAAI,CACV,qBAAqB,EACrB,OAAO,CACL,MAAM,qBAAqB,EAC3B,OAAO,GAAG,mBAAmB,GAAG,SAAS,GAAG,wBAAwB,GAAG,WAAW,GAAG,0BAA0B,GAAG,SAAS,GAAG,QAAQ,GAAG,OAAO,CACjJ,CACF;IACD;;;OAGG;IACH,kBAAkB,EAAE,yBAAyB,CAAC;CAC/C;AAED;;;;GAIG;AACH,MAAM,CAAC,OAAO,UAAU,mBAAmB,CAAC,OAAO,EAAE,wBAAwB,GAAG,GAAG,CAAC,OAAO,CAmF1F"}
|
|
@@ -26,7 +26,7 @@ const messages = defineMessages({
|
|
|
26
26
|
defaultMessage: 'ui.notification.mention.quotedYou'
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
-
const PREFIX = '
|
|
29
|
+
const PREFIX = 'SCNotificationMention';
|
|
30
30
|
const classes = {
|
|
31
31
|
root: `${PREFIX}-root`,
|
|
32
32
|
avatar: `${PREFIX}-avatar`,
|
|
@@ -35,7 +35,7 @@ const classes = {
|
|
|
35
35
|
activeAt: `${PREFIX}-active-at`,
|
|
36
36
|
contributionText: `${PREFIX}-contribution-text`
|
|
37
37
|
};
|
|
38
|
-
const Root = styled(
|
|
38
|
+
const Root = styled(NotificationItem, {
|
|
39
39
|
name: PREFIX,
|
|
40
40
|
slot: 'Root',
|
|
41
41
|
overridesResolver: (props, styles) => styles.root
|
|
@@ -80,22 +80,21 @@ export default function MentionNotification(inProps) {
|
|
|
80
80
|
/**
|
|
81
81
|
* Renders root object
|
|
82
82
|
*/
|
|
83
|
-
return (React.createElement(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`)
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
React.createElement(
|
|
93
|
-
|
|
94
|
-
template === SCNotificationObjectTemplateType.
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
React.createElement(
|
|
98
|
-
React.createElement(
|
|
99
|
-
React.createElement(FormattedMessage, { id: "ui.userToastNotifications.viewContribution", defaultMessage: 'ui.userToastNotifications.viewContribution' })))))) })));
|
|
83
|
+
return (React.createElement(Root, Object.assign({ id: id, className: classNames(classes.root, className, `${PREFIX}-${template}`), template: template, isNew: notificationObject.is_new, disableTypography: true, image: React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject[objectType].author) },
|
|
84
|
+
React.createElement(Avatar, { alt: notificationObject[objectType].author.username, variant: "circular", src: notificationObject[objectType].author.avatar, classes: { root: classes.avatar } })), primary: React.createElement(Typography, { component: "div", color: "inherit", className: classes.mentionText },
|
|
85
|
+
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, notificationObject[objectType].author), className: classes.username }, notificationObject[objectType].author.username),
|
|
86
|
+
' ',
|
|
87
|
+
intl.formatMessage(messages.quotedYouOn, {
|
|
88
|
+
b: (...chunks) => React.createElement("strong", null, chunks)
|
|
89
|
+
}),
|
|
90
|
+
' '), secondary: React.createElement(React.Fragment, null,
|
|
91
|
+
React.createElement(Link, { to: scRoutingContext.url(SCRoutes[`${objectType.toUpperCase()}_ROUTE_NAME`], getRouteData(notificationObject[objectType])) },
|
|
92
|
+
React.createElement(Typography, { component: 'span', variant: "body2", className: classes.contributionText }, getContributionSnippet(notificationObject[objectType]))),
|
|
93
|
+
(template === SCNotificationObjectTemplateType.DETAIL || template === SCNotificationObjectTemplateType.SNIPPET) && (React.createElement(Box, null,
|
|
94
|
+
React.createElement(DateTimeAgo, { date: notificationObject.active_at, className: classes.activeAt })))), footer: template === SCNotificationObjectTemplateType.TOAST && (React.createElement(Stack, { direction: "row", justifyContent: "space-between", alignItems: "center", spacing: 2 },
|
|
95
|
+
React.createElement(DateTimeAgo, { date: notificationObject.active_at }),
|
|
96
|
+
React.createElement(Typography, { color: "primary", component: 'div' },
|
|
97
|
+
React.createElement(Link, { to: scRoutingContext.url(SCRoutes[`${contribution.type.toUpperCase()}_ROUTE_NAME`], getRouteData(contribution)) },
|
|
98
|
+
React.createElement(FormattedMessage, { id: "ui.userToastNotifications.viewContribution", defaultMessage: 'ui.userToastNotifications.viewContribution' }))))) }, rest)));
|
|
100
99
|
}
|
|
101
100
|
//# sourceMappingURL=Mention.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Mention.js","sourceRoot":"","sources":["../../../../../src/components/Notification/Mention/Mention.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAC,IAAI,EAAE,QAAQ,EAAwB,YAAY,EAAC,MAAM,2BAA2B,CAAC;AAE7F,OAAO,EAAC,cAAc,EAAE,gBAAgB,EAAE,OAAO,EAAC,MAAM,YAAY,CAAC;AACrE,OAAO,EAAC,YAAY,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,eAAe,EAAC,MAAM,6BAA6B,CAAC;AACvH,OAAO,WAAW,MAAM,6BAA6B,CAAC;AACtD,OAAO,UAAU,MAAM,YAAY,CAAC;AACpC,OAAO,EAAC,gCAAgC,EAAC,MAAM,gBAAgB,CAAC;AAChE,OAAO,EAAC,aAAa,EAAC,MAAM,aAAa,CAAC;AAC1C,OAAO,
|
|
1
|
+
{"version":3,"file":"Mention.js","sourceRoot":"","sources":["../../../../../src/components/Notification/Mention/Mention.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,EAAC,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AAC,UAAU,IAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAC,OAAO,EAAC,SAAS,EAAE,OAAO,CAAC,gBAAgB,IAC/E,sBAAsB,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAC5C,CACR;YACN,CAAC,QAAQ,KAAK,gCAAgC,CAAC,MAAM,IAAI,QAAQ,KAAK,gCAAgC,CAAC,OAAO,CAAC,IAAI,CAClH,oBAAC,GAAG;gBACF,oBAAC,WAAW,IAAC,IAAI,EAAE,kBAAkB,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,QAAQ,GAAI,CAC5E,CACP,CACc,EAEnB,MAAM,EACJ,QAAQ,KAAK,gCAAgC,CAAC,KAAK,IAAI,CACrD,oBAAC,KAAK,IAAC,SAAS,EAAC,KAAK,EAAC,cAAc,EAAC,eAAe,EAAC,UAAU,EAAC,QAAQ,EAAC,OAAO,EAAE,CAAC;YAClF,oBAAC,WAAW,IAAC,IAAI,EAAE,kBAAkB,CAAC,SAAS,GAAI;YACnD,oBAAC,UAAU,IAAC,KAAK,EAAC,SAAS,EAAC,SAAS,EAAE,KAAK;gBAC1C,oBAAC,IAAI,IAAC,EAAE,EAAE,gBAAgB,CAAC,GAAG,CAAC,QAAQ,CAAC,GAAG,YAAY,CAAC,IAAI,CAAC,WAAW,EAAE,aAAa,CAAC,EAAE,YAAY,CAAC,YAAY,CAAC,CAAC;oBACnH,oBAAC,gBAAgB,IAAC,EAAE,EAAC,4CAA4C,EAAC,cAAc,EAAE,4CAA4C,GAAI,CAC7H,CACI,CACP,CACT,IAEC,IAAI,EACR,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -53,24 +53,24 @@ export interface NotificationProps extends CardProps, VirtualScrollerItemProps {
|
|
|
53
53
|
|
|
54
54
|
#### Component Name
|
|
55
55
|
|
|
56
|
-
The name `
|
|
56
|
+
The name `SCNotification` can be used when providing style overrides in the theme.
|
|
57
57
|
|
|
58
58
|
|
|
59
59
|
#### CSS
|
|
60
60
|
|
|
61
61
|
|Rule Name|Global class|Description|
|
|
62
62
|
|---|---|---|
|
|
63
|
-
|root|.
|
|
64
|
-
|
|
|
65
|
-
|
|
|
66
|
-
|title|.
|
|
67
|
-
|image|.
|
|
68
|
-
|username|.
|
|
69
|
-
|
|
|
70
|
-
|
|
|
71
|
-
|
|
|
72
|
-
|
|
|
73
|
-
|showOtherAggregated|.
|
|
63
|
+
|root|.SCNotification-root|Styles applied to the root element.|
|
|
64
|
+
|content|.SCNotification-notification-wrap|Styles applied to the element wrap.|
|
|
65
|
+
|header|.SCNotification-notification-wrap|Styles applied to the notification header.|
|
|
66
|
+
|title|.SCNotification-title|Styles applied to the title element in the notification header.|
|
|
67
|
+
|image|.SCNotification-image|Styles applied to the image element in the notification header.|
|
|
68
|
+
|username|.SCNotification-username|Styles applied to the user element in the notification header.|
|
|
69
|
+
|content|.SCNotification-notification-content|Styles applied to the notification content.|
|
|
70
|
+
|unCollapsed|.SCNotification-notification-wrap|Styles applied to the uncollapsed elements.|
|
|
71
|
+
|collapsed|.SCNotification-notification-wrap|Styles applied to the collapsed elements.|
|
|
72
|
+
|stopButton|.SCNotification-stop-notification-button|Styles applied to the stop notification button.|
|
|
73
|
+
|showOtherAggregated|.SCNotification-show-other-aggregated|Styles applied to the show other aggregated element.|
|
|
74
74
|
|
|
75
75
|
* @param inProps
|
|
76
76
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.d.ts","sourceRoot":"","sources":["../../../../src/components/Notification/Notification.tsx"],"names":[],"mappings":"AAqBA,OAAO,
|
|
1
|
+
{"version":3,"file":"Notification.d.ts","sourceRoot":"","sources":["../../../../src/components/Notification/Notification.tsx"],"names":[],"mappings":"AAqBA,OAAO,EAAqB,SAAS,EAAqE,MAAM,eAAe,CAAC;AAKhI,OAAO,EAAC,wBAAwB,EAAC,MAAM,6BAA6B,CAAC;AAOrE,OAAO,EAEL,4BAA4B,EAI7B,MAAM,sBAAsB,CAAC;AA+B9B,MAAM,WAAW,iBAAkB,SAAQ,SAAS,EAAE,wBAAwB;IAC5E;;;OAGG;IACH,EAAE,CAAC,EAAE,MAAM,CAAC;IAEZ;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;;OAGG;IACH,kBAAkB,EAAE,4BAA4B,CAAC;IAEjD;;;OAGG;IACH,wBAAwB,CAAC,EAAE,CAAC,IAAI,KAAA,KAAK,GAAG,CAAC,OAAO,CAAC;IAEjD;;;OAGG;IACH,wBAAwB,CAAC,EAAE,OAAO,CAAC;IAEnC;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IAEZ;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,GAAG,GAAG,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,OAAO,EAAE,iBAAiB,GAAG,GAAG,CAAC,OAAO,CA4ThF"}
|
|
@@ -23,14 +23,13 @@ import MentionNotification from './Mention';
|
|
|
23
23
|
import CollapsedForNotification from './CollapsedFor';
|
|
24
24
|
import KindlyNoticeForNotification from './KindlyNoticeFor';
|
|
25
25
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
26
|
-
import { grey } from '@mui/material/colors';
|
|
27
26
|
import KindlyNoticeFlagNotification from './KindlyNoticeFlag';
|
|
28
27
|
import VoteUpNotification from './VoteUp';
|
|
29
28
|
import Icon from '@mui/material/Icon';
|
|
30
29
|
import { SCOPE_SC_UI } from '../../constants/Errors';
|
|
31
30
|
import { getContribution, getContributionRouteName, getContributionSnippet, getRouteData } from '../../utils/contribution';
|
|
32
31
|
import ContributionFollowNotification from './ContributionFollow';
|
|
33
|
-
import { Avatar, Collapse, ListItemButton, ListItemText,
|
|
32
|
+
import { Avatar, CardHeader, Collapse, ListItemButton, ListItemText, Tooltip } from '@mui/material';
|
|
34
33
|
import IncubatorApprovedNotification from './IncubatorApproved';
|
|
35
34
|
import { http, Endpoints } from '@selfcommunity/api-services';
|
|
36
35
|
import { Link, SCRoutes, useSCRouting } from '@selfcommunity/react-core';
|
|
@@ -39,81 +38,33 @@ import classNames from 'classnames';
|
|
|
39
38
|
import LoadingButton from '@mui/lab/LoadingButton';
|
|
40
39
|
import Widget from '../Widget';
|
|
41
40
|
import { useThemeProps } from '@mui/system';
|
|
42
|
-
import BaseItem from '../../shared/BaseItem';
|
|
43
41
|
import { Logger } from '@selfcommunity/utils';
|
|
44
|
-
import {
|
|
42
|
+
import { SCNotificationTypologyType } from '@selfcommunity/types';
|
|
45
43
|
const messages = defineMessages({
|
|
46
44
|
receivePrivateMessage: {
|
|
47
45
|
id: 'ui.notification.receivePrivateMessage',
|
|
48
46
|
defaultMessage: 'ui.notification.receivePrivateMessage'
|
|
49
47
|
}
|
|
50
48
|
});
|
|
51
|
-
const PREFIX = '
|
|
49
|
+
const PREFIX = 'SCNotification';
|
|
52
50
|
const classes = {
|
|
53
51
|
root: `${PREFIX}-root`,
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
header: `${PREFIX}-header`,
|
|
53
|
+
avatar: `${PREFIX}-avatar`,
|
|
56
54
|
title: `${PREFIX}-title`,
|
|
57
55
|
image: `${PREFIX}-image`,
|
|
58
56
|
username: `${PREFIX}-username`,
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
57
|
+
content: `${PREFIX}-content`,
|
|
58
|
+
unCollapsed: `${PREFIX}-uncollapsed`,
|
|
59
|
+
collapsed: `${PREFIX}-collapsed`,
|
|
60
|
+
stopButton: `${PREFIX}-stop-button`,
|
|
63
61
|
showOtherAggregated: `${PREFIX}-show-other-aggregated`
|
|
64
62
|
};
|
|
65
63
|
const Root = styled(Widget, {
|
|
66
64
|
name: PREFIX,
|
|
67
65
|
slot: 'Root',
|
|
68
66
|
overridesResolver: (props, styles) => styles.root
|
|
69
|
-
})(({ theme }) => ({
|
|
70
|
-
width: '100%',
|
|
71
|
-
marginBottom: theme.spacing(1),
|
|
72
|
-
[`& .${classes.title}`]: {
|
|
73
|
-
fontSize: 15,
|
|
74
|
-
padding: `${theme.spacing()} ${theme.spacing(2)} 5px ${theme.spacing(2)}`,
|
|
75
|
-
'&:hover': {
|
|
76
|
-
textDecoration: 'underline'
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
[`& .${classes.username}`]: {
|
|
80
|
-
fontWeight: 700,
|
|
81
|
-
'&:hover': {
|
|
82
|
-
textDecoration: 'underline'
|
|
83
|
-
}
|
|
84
|
-
},
|
|
85
|
-
[`& .${classes.notificationWrap}`]: {
|
|
86
|
-
padding: `${theme.spacing()} 0px`
|
|
87
|
-
},
|
|
88
|
-
[`& .${classes.notificationContent}`]: {
|
|
89
|
-
position: 'relative'
|
|
90
|
-
},
|
|
91
|
-
[`& .${classes.notificationHeader}`]: {
|
|
92
|
-
boxSizing: 'border-box',
|
|
93
|
-
boxShadow: 'none',
|
|
94
|
-
border: 'none'
|
|
95
|
-
},
|
|
96
|
-
[`& .${classes.stopNotificationButton}`]: {
|
|
97
|
-
margin: '5px 10px',
|
|
98
|
-
padding: '2px 2px 2px 2px',
|
|
99
|
-
minWidth: 'auto',
|
|
100
|
-
'& span': {
|
|
101
|
-
fontSize: 20
|
|
102
|
-
}
|
|
103
|
-
},
|
|
104
|
-
[`& .${classes.showOtherAggregated}`]: {
|
|
105
|
-
position: 'relative',
|
|
106
|
-
top: theme.spacing(),
|
|
107
|
-
backgroundColor: grey[100]
|
|
108
|
-
},
|
|
109
|
-
[`& .${classes.notificationCollapsed}`]: {
|
|
110
|
-
paddingTop: theme.spacing()
|
|
111
|
-
},
|
|
112
|
-
'& a': {
|
|
113
|
-
textDecoration: 'none',
|
|
114
|
-
color: theme.palette.text.primary
|
|
115
|
-
}
|
|
116
|
-
}));
|
|
67
|
+
})(({ theme }) => ({}));
|
|
117
68
|
/**
|
|
118
69
|
*
|
|
119
70
|
> API documentation for the Community-JS UserNotification component. Learn about the available props and the CSS API.
|
|
@@ -126,24 +77,24 @@ const Root = styled(Widget, {
|
|
|
126
77
|
|
|
127
78
|
#### Component Name
|
|
128
79
|
|
|
129
|
-
The name `
|
|
80
|
+
The name `SCNotification` can be used when providing style overrides in the theme.
|
|
130
81
|
|
|
131
82
|
|
|
132
83
|
#### CSS
|
|
133
84
|
|
|
134
85
|
|Rule Name|Global class|Description|
|
|
135
86
|
|---|---|---|
|
|
136
|
-
|root|.
|
|
137
|
-
|
|
|
138
|
-
|
|
|
139
|
-
|title|.
|
|
140
|
-
|image|.
|
|
141
|
-
|username|.
|
|
142
|
-
|
|
|
143
|
-
|
|
|
144
|
-
|
|
|
145
|
-
|
|
|
146
|
-
|showOtherAggregated|.
|
|
87
|
+
|root|.SCNotification-root|Styles applied to the root element.|
|
|
88
|
+
|content|.SCNotification-notification-wrap|Styles applied to the element wrap.|
|
|
89
|
+
|header|.SCNotification-notification-wrap|Styles applied to the notification header.|
|
|
90
|
+
|title|.SCNotification-title|Styles applied to the title element in the notification header.|
|
|
91
|
+
|image|.SCNotification-image|Styles applied to the image element in the notification header.|
|
|
92
|
+
|username|.SCNotification-username|Styles applied to the user element in the notification header.|
|
|
93
|
+
|content|.SCNotification-notification-content|Styles applied to the notification content.|
|
|
94
|
+
|unCollapsed|.SCNotification-notification-wrap|Styles applied to the uncollapsed elements.|
|
|
95
|
+
|collapsed|.SCNotification-notification-wrap|Styles applied to the collapsed elements.|
|
|
96
|
+
|stopButton|.SCNotification-stop-notification-button|Styles applied to the stop notification button.|
|
|
97
|
+
|showOtherAggregated|.SCNotification-show-other-aggregated|Styles applied to the show other aggregated element.|
|
|
147
98
|
|
|
148
99
|
* @param inProps
|
|
149
100
|
*/
|
|
@@ -263,14 +214,14 @@ export default function UserNotification(inProps) {
|
|
|
263
214
|
*/
|
|
264
215
|
if (notificationObject.aggregated && notificationObject.aggregated[0].type === SCNotificationTypologyType.PRIVATE_MESSAGE) {
|
|
265
216
|
let messageNotification = notificationObject.aggregated[0];
|
|
266
|
-
return (React.createElement(
|
|
267
|
-
React.createElement(Avatar, { alt: messageNotification.message.sender.username, variant: "circular", src: messageNotification.message.sender.avatar })),
|
|
217
|
+
return (React.createElement(CardHeader, { className: classes.header, avatar: React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, messageNotification.message.sender) },
|
|
218
|
+
React.createElement(Avatar, { className: classes.avatar, alt: messageNotification.message.sender.username, variant: "circular", src: messageNotification.message.sender.avatar })), titleTypographyProps: { className: classes.title, variant: 'subtitle1' }, title: React.createElement(React.Fragment, null,
|
|
268
219
|
React.createElement(Link, { to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, messageNotification.message.sender), className: classes.username }, messageNotification.message.sender.username),
|
|
269
220
|
' ',
|
|
270
221
|
intl.formatMessage(messages.receivePrivateMessage, {
|
|
271
222
|
total: notificationObject.aggregated.length,
|
|
272
223
|
b: (...chunks) => React.createElement("strong", null, chunks)
|
|
273
|
-
}))
|
|
224
|
+
})) }));
|
|
274
225
|
}
|
|
275
226
|
/**
|
|
276
227
|
* Comment, NestedComment, Follow Contribution header
|
|
@@ -283,11 +234,8 @@ export default function UserNotification(inProps) {
|
|
|
283
234
|
notificationObject.aggregated[0].type === SCNotificationTypologyType.VOTE_UP ||
|
|
284
235
|
notificationObject.aggregated[0].type === SCNotificationTypologyType.CONTRIBUTION)) {
|
|
285
236
|
const contribution = getContribution(notificationObject);
|
|
286
|
-
return (React.createElement(
|
|
287
|
-
|
|
288
|
-
React.createElement(Typography, { variant: "body2", gutterBottom: true, classes: { root: classes.title } }, getContributionSnippet(contribution))),
|
|
289
|
-
contribution && (React.createElement(Tooltip, { title: contribution.suspended ? (React.createElement(FormattedMessage, { id: 'ui.notification.notificationSuspended', defaultMessage: 'ui.notification.notificationSuspended' })) : (React.createElement(FormattedMessage, { id: 'ui.notification.notificationSuspend', defaultMessage: 'ui.notification.notificationSuspend' })) },
|
|
290
|
-
React.createElement(LoadingButton, { variant: "text", size: "small", loading: loadingSuspendNotification, color: 'inherit', classes: { root: classes.stopNotificationButton }, onClick: () => handleStopContentNotification(contribution) }, contribution.suspended ? (React.createElement(Icon, { fontSize: "small", color: 'primary' }, "notifications_off")) : (React.createElement(Icon, { fontSize: "small", color: 'inherit' }, "notifications")))))))));
|
|
237
|
+
return (React.createElement(CardHeader, { className: classes.header, titleTypographyProps: { className: classes.title, variant: 'subtitle1' }, title: React.createElement(Link, { to: scRoutingContext.url(getContributionRouteName(contribution), getRouteData(notificationObject[contribution.type])) }, getContributionSnippet(contribution)), action: contribution && (React.createElement(Tooltip, { title: contribution.suspended ? (React.createElement(FormattedMessage, { id: 'ui.notification.notificationSuspended', defaultMessage: 'ui.notification.notificationSuspended' })) : (React.createElement(FormattedMessage, { id: 'ui.notification.notificationSuspend', defaultMessage: 'ui.notification.notificationSuspend' })) },
|
|
238
|
+
React.createElement(LoadingButton, { variant: "text", size: "small", loading: loadingSuspendNotification, color: 'inherit', classes: { root: classes.stopButton }, onClick: () => handleStopContentNotification(contribution) }, contribution.suspended ? (React.createElement(Icon, { fontSize: "small", color: 'primary' }, "notifications_off")) : (React.createElement(Icon, { fontSize: "small", color: 'inherit' }, "notifications"))))) }));
|
|
291
239
|
}
|
|
292
240
|
return null;
|
|
293
241
|
}
|
|
@@ -363,14 +311,13 @@ export default function UserNotification(inProps) {
|
|
|
363
311
|
* Renders root object
|
|
364
312
|
*/
|
|
365
313
|
return (React.createElement(Root, Object.assign({ id: id, className: classNames(classes.root, className) }, rest),
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
React.createElement("div", { className: classes.
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
React.createElement(
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
React.createElement(Collapse, { in: openOtherAggregated, timeout: "auto", unmountOnExit: true, classes: { root: classes.notificationCollapsed } }, notificationObject.aggregated.slice(showMaxAggregated).map((n, i) => renderAggregatedItem(n, i)))))))));
|
|
314
|
+
renderNotificationHeader(),
|
|
315
|
+
React.createElement(CardContent, { className: classes.content },
|
|
316
|
+
React.createElement("div", { className: classes.unCollapsed }, notificationObject.aggregated.slice(0, showMaxAggregated).map((n, i) => renderAggregatedItem(n, i))),
|
|
317
|
+
notificationObject.aggregated.length > showMaxAggregated && (React.createElement(React.Fragment, null,
|
|
318
|
+
React.createElement(ListItemButton, { onClick: setStateAggregated, classes: { root: classes.showOtherAggregated } },
|
|
319
|
+
React.createElement(ListItemText, { primary: React.createElement(FormattedMessage, { id: 'ui.notification.showOthers', defaultMessage: 'ui.notification.showOthers' }) }),
|
|
320
|
+
openOtherAggregated ? React.createElement(Icon, null, "expand_less") : React.createElement(Icon, null, "expand_more")),
|
|
321
|
+
React.createElement(Collapse, { in: openOtherAggregated, timeout: "auto", unmountOnExit: true, classes: { root: classes.collapsed } }, notificationObject.aggregated.slice(showMaxAggregated).map((n, i) => renderAggregatedItem(n, i))))))));
|
|
375
322
|
}
|
|
376
323
|
//# sourceMappingURL=Notification.js.map
|