@selfcommunity/react-ui 0.6.1-alpha.0 → 0.6.1-alpha.2
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/Editor/plugins/MentionsPlugin.d.ts.map +1 -1
- package/lib/cjs/components/Editor/plugins/MentionsPlugin.js +4 -1
- package/lib/cjs/components/Editor/plugins/MentionsPlugin.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Actions.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Actions.js +4 -4
- package/lib/cjs/components/FeedObject/Actions/Actions.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.d.ts.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.js +16 -39
- package/lib/cjs/components/FeedObject/Actions/Reaction/Reaction.js.map +1 -1
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts +41 -0
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts.map +1 -0
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.js +143 -0
- package/lib/cjs/components/FeedObject/Actions/Reaction/ReactionsPopover.js.map +1 -0
- package/lib/cjs/components/User/User.d.ts +9 -0
- package/lib/cjs/components/User/User.d.ts.map +1 -1
- package/lib/cjs/components/User/User.js +9 -2
- package/lib/cjs/components/User/User.js.map +1 -1
- package/lib/esm/components/Editor/plugins/MentionsPlugin.d.ts.map +1 -1
- package/lib/esm/components/Editor/plugins/MentionsPlugin.js +4 -1
- package/lib/esm/components/Editor/plugins/MentionsPlugin.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Actions.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Actions.js +5 -5
- package/lib/esm/components/FeedObject/Actions/Actions.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.d.ts.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.js +18 -41
- package/lib/esm/components/FeedObject/Actions/Reaction/Reaction.js.map +1 -1
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts +41 -0
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.d.ts.map +1 -0
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.js +114 -0
- package/lib/esm/components/FeedObject/Actions/Reaction/ReactionsPopover.js.map +1 -0
- package/lib/esm/components/User/User.d.ts +9 -0
- package/lib/esm/components/User/User.d.ts.map +1 -1
- package/lib/esm/components/User/User.js +10 -3
- package/lib/esm/components/User/User.js.map +1 -1
- package/lib/umd/react-ui.js +1 -1
- package/lib/umd/react-ui.js.map +1 -1
- package/package.json +2 -2
|
@@ -12,7 +12,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { styled } from '@mui/material/styles';
|
|
14
14
|
import UserSkeleton from './Skeleton';
|
|
15
|
-
import { Avatar, Button } from '@mui/material';
|
|
15
|
+
import { Avatar, Badge, Button } from '@mui/material';
|
|
16
16
|
import { Link, SCRoutes, useSCFetchUser, useSCRouting } from '@selfcommunity/react-core';
|
|
17
17
|
import { defineMessages, FormattedMessage, useIntl } from 'react-intl';
|
|
18
18
|
import classNames from 'classnames';
|
|
@@ -62,7 +62,13 @@ export default function User(inProps) {
|
|
|
62
62
|
props: inProps,
|
|
63
63
|
name: PREFIX
|
|
64
64
|
});
|
|
65
|
-
const { userId = null, user = null, handleIgnoreAction, className = null, followConnectUserButtonProps = {}, showFollowers = false, elevation } = props, rest = __rest(props, ["userId", "user", "handleIgnoreAction", "className", "followConnectUserButtonProps", "showFollowers", "elevation"]);
|
|
65
|
+
const { userId = null, user = null, handleIgnoreAction, className = null, followConnectUserButtonProps = {}, showFollowers = false, elevation, showReaction = false, reaction } = props, rest = __rest(props, ["userId", "user", "handleIgnoreAction", "className", "followConnectUserButtonProps", "showFollowers", "elevation", "showReaction", "reaction"]);
|
|
66
|
+
const SmallAvatar = styled(Avatar)(({ theme }) => ({
|
|
67
|
+
width: 12,
|
|
68
|
+
height: 12,
|
|
69
|
+
backgroundColor: theme.palette.common.white,
|
|
70
|
+
border: `2px solid ${theme.palette.background.paper}`
|
|
71
|
+
}));
|
|
66
72
|
// STATE
|
|
67
73
|
const { scUser, setSCUser } = useSCFetchUser({ id: userId, user });
|
|
68
74
|
// CONTEXT
|
|
@@ -88,6 +94,7 @@ export default function User(inProps) {
|
|
|
88
94
|
/**
|
|
89
95
|
* Renders root object
|
|
90
96
|
*/
|
|
91
|
-
return (React.createElement(Root, Object.assign({ elevation: elevation }, rest, { className: classNames(classes.root, className), ButtonBaseProps: { component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, scUser) }, image: React.createElement(
|
|
97
|
+
return (React.createElement(Root, Object.assign({ elevation: elevation }, rest, { className: classNames(classes.root, className), ButtonBaseProps: { component: Link, to: scRoutingContext.url(SCRoutes.USER_PROFILE_ROUTE_NAME, scUser) }, image: showReaction ? (React.createElement(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: React.createElement(SmallAvatar, { alt: reaction.label, src: reaction.image }) },
|
|
98
|
+
React.createElement(Avatar, { alt: scUser.username, src: scUser.avatar }))) : (React.createElement(Avatar, { alt: scUser.username, src: scUser.avatar })), primary: scUser.username, secondary: showFollowers ? `${intl.formatMessage(messages.userFollowers, { total: scUser.followers_counter })}` : scUser.description, actions: renderAuthenticatedActions() })));
|
|
92
99
|
}
|
|
93
100
|
//# sourceMappingURL=User.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../../src/components/User/User.tsx"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,sBAAsB,CAAC;AAC5C,OAAO,YAAY,MAAM,YAAY,CAAC;AACt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