@selfcommunity/react-ui 1.2.0-alpha.5 → 1.2.0-alpha.6
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.
|
@@ -26,7 +26,8 @@ const classes = {
|
|
|
26
26
|
divider: `${constants_1.PREFIX}-action-comment-divider`,
|
|
27
27
|
inline: `${constants_1.PREFIX}-action-comment-inline`,
|
|
28
28
|
button: `${constants_1.PREFIX}-action-comment-button`,
|
|
29
|
-
viewAudienceButton: `${constants_1.PREFIX}-action-comment-view-audience-button
|
|
29
|
+
viewAudienceButton: `${constants_1.PREFIX}-action-comment-view-audience-button`,
|
|
30
|
+
paperContrastColor: `${constants_1.PREFIX}-paper-contrast-color`
|
|
30
31
|
};
|
|
31
32
|
const Root = (0, material_1.styled)(material_1.Box, {
|
|
32
33
|
name: constants_1.PREFIX,
|
|
@@ -52,7 +53,9 @@ function Comment(props) {
|
|
|
52
53
|
audience = ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", disabled: true, color: "inherit" }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { animation: "wave", height: 18, width: 50 }) })));
|
|
53
54
|
}
|
|
54
55
|
else {
|
|
55
|
-
audience = ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: onViewCommentsAction ? ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", onClick: onViewCommentsAction, color: "inherit" }, { children:
|
|
56
|
+
audience = ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: onViewCommentsAction ? ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", onClick: onViewCommentsAction, color: "inherit" }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span", sx: { '&': { all: 'unset' } }, className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` })) }))) : ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: feedObjectTemplate === feedObject_1.SCFeedObjectTemplateType.DETAIL ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.comments, {
|
|
57
|
+
total: obj.comment_count
|
|
58
|
+
})}` }))) : ((0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "text", size: "small", component: react_core_1.Link, to: scRoutingContext.url((0, contribution_1.getContributionRouteName)(obj), (0, contribution_1.getRouteData)(obj)), classes: { root: classes.viewAudienceButton } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ component: "span", sx: { '&': { all: 'unset' } }, className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` })) }))) })) }));
|
|
56
59
|
}
|
|
57
60
|
}
|
|
58
61
|
return audience;
|
|
@@ -24,7 +24,8 @@ const classes = {
|
|
|
24
24
|
divider: `${PREFIX}-action-comment-divider`,
|
|
25
25
|
inline: `${PREFIX}-action-comment-inline`,
|
|
26
26
|
button: `${PREFIX}-action-comment-button`,
|
|
27
|
-
viewAudienceButton: `${PREFIX}-action-comment-view-audience-button
|
|
27
|
+
viewAudienceButton: `${PREFIX}-action-comment-view-audience-button`,
|
|
28
|
+
paperContrastColor: `${PREFIX}-paper-contrast-color`
|
|
28
29
|
};
|
|
29
30
|
const Root = styled(Box, {
|
|
30
31
|
name: PREFIX,
|
|
@@ -50,7 +51,9 @@ export default function Comment(props) {
|
|
|
50
51
|
audience = (_jsx(Button, Object.assign({ variant: "text", size: "small", disabled: true, color: "inherit" }, { children: _jsx(Skeleton, { animation: "wave", height: 18, width: 50 }) })));
|
|
51
52
|
}
|
|
52
53
|
else {
|
|
53
|
-
audience = (_jsx(_Fragment, { children: onViewCommentsAction ? (_jsx(Button, Object.assign({ variant: "text", size: "small", onClick: onViewCommentsAction, color: "inherit" }, { children:
|
|
54
|
+
audience = (_jsx(_Fragment, { children: onViewCommentsAction ? (_jsx(Button, Object.assign({ variant: "text", size: "small", onClick: onViewCommentsAction, color: "inherit" }, { children: _jsx(Typography, Object.assign({ component: "span", sx: { '&': { all: 'unset' } }, className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` })) }))) : (_jsx(_Fragment, { children: feedObjectTemplate === SCFeedObjectTemplateType.DETAIL ? (_jsx(Typography, Object.assign({ variant: "body2", className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.comments, {
|
|
55
|
+
total: obj.comment_count
|
|
56
|
+
})}` }))) : (_jsx(Button, Object.assign({ variant: "text", size: "small", component: Link, to: scRoutingContext.url(getContributionRouteName(obj), getRouteData(obj)), classes: { root: classes.viewAudienceButton } }, { children: _jsx(Typography, Object.assign({ component: "span", sx: { '&': { all: 'unset' } }, className: classes.paperContrastColor }, { children: `${intl.formatMessage(messages.comments, { total: obj.comment_count })}` })) }))) })) }));
|
|
54
57
|
}
|
|
55
58
|
}
|
|
56
59
|
return audience;
|