@selfcommunity/react-ui 0.11.0-alpha.5 → 0.11.0-alpha.7
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.
|
@@ -43,7 +43,7 @@ function Activities(props) {
|
|
|
43
43
|
: comments_1.SCCommentsOrderBy.ADDED_AT_DESC
|
|
44
44
|
});
|
|
45
45
|
const objId = commentsObject.feedObject ? commentsObject.feedObject.id : null;
|
|
46
|
-
const skeletonsCount = Math.min(
|
|
46
|
+
const skeletonsCount = Math.min(2, commentsObject.feedObject ? commentsObject.feedObject.comment_count : 2);
|
|
47
47
|
const existFeedObjectActivities = feedObjectActivities && feedObjectActivities.length > 0;
|
|
48
48
|
/**
|
|
49
49
|
* Sync activities type if prop change
|
|
@@ -57,8 +57,7 @@ exports.getContributionSnippet = getContributionSnippet;
|
|
|
57
57
|
* @param handleUrl Func that handle urls
|
|
58
58
|
*/
|
|
59
59
|
function getContributionHtml(html, handleUrl) {
|
|
60
|
-
|
|
61
|
-
return _html.replace(/<mention.*? id="([0-9]+)"{1}.*?>@([a-z\d_-]+)<\/mention>/gi, (match, id, username) => {
|
|
60
|
+
return html.replace(/<mention.*? id="([0-9]+)"{1}.*?>@([a-z\d_-]+)<\/mention>/gi, (match, id, username) => {
|
|
62
61
|
return `<a href='${handleUrl(react_core_1.SCRoutes.USER_PROFILE_ROUTE_NAME, { id, username })}'>@${username}</a>`;
|
|
63
62
|
});
|
|
64
63
|
}
|
|
@@ -41,7 +41,7 @@ export default function Activities(props) {
|
|
|
41
41
|
: SCCommentsOrderBy.ADDED_AT_DESC
|
|
42
42
|
});
|
|
43
43
|
const objId = commentsObject.feedObject ? commentsObject.feedObject.id : null;
|
|
44
|
-
const skeletonsCount = Math.min(
|
|
44
|
+
const skeletonsCount = Math.min(2, commentsObject.feedObject ? commentsObject.feedObject.comment_count : 2);
|
|
45
45
|
const existFeedObjectActivities = feedObjectActivities && feedObjectActivities.length > 0;
|
|
46
46
|
/**
|
|
47
47
|
* Sync activities type if prop change
|
|
@@ -51,8 +51,7 @@ export function getContributionSnippet(obj) {
|
|
|
51
51
|
* @param handleUrl Func that handle urls
|
|
52
52
|
*/
|
|
53
53
|
export function getContributionHtml(html, handleUrl) {
|
|
54
|
-
|
|
55
|
-
return _html.replace(/<mention.*? id="([0-9]+)"{1}.*?>@([a-z\d_-]+)<\/mention>/gi, (match, id, username) => {
|
|
54
|
+
return html.replace(/<mention.*? id="([0-9]+)"{1}.*?>@([a-z\d_-]+)<\/mention>/gi, (match, id, username) => {
|
|
56
55
|
return `<a href='${handleUrl(SCRoutes.USER_PROFILE_ROUTE_NAME, { id, username })}'>@${username}</a>`;
|
|
57
56
|
});
|
|
58
57
|
}
|