@corva/ui 0.38.0-1 → 0.38.0-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.
|
@@ -1 +1 @@
|
|
|
1
|
-
import e from"prop-types";import t from"classnames";import{withStyles as r}from"@material-ui/core/styles";import{Typography as
|
|
1
|
+
import e from"prop-types";import t from"classnames";import{withStyles as r}from"@material-ui/core/styles";import{Tooltip as o,Typography as s}from"@material-ui/core";import a from"@material-ui/core/colors/grey";import{isNativeDetected as i}from"../../utils/mobileDetect.js";import n from"../Avatar/index.js";import c from"../UserCardPopover.js";import m from"./styles.css.js";import{jsxs as l,Fragment as u,jsx as p}from"react/jsx-runtime";var d=function(e){return e?"".concat(e.first_name," ").concat(e.last_name):""},h=function(e){var t=e.users,r=e.noReactionsText,o=t.length;if(!o)return r;var s="";o>19&&(s="\nand ".concat(o-19," more..."));var a=t.slice(0,19).join("\n");return"".concat(a).concat(s)},f=function(e){var r=e.likesCount,a=e.usersWhoLike,i=e.commentsCount,f=e.usersWhoCommented,v=e.onCommentsClick,y=e.currentUser,C=e.activeUsersList,k=e.classes,g=e.isNative,N=e.small;return l(u,{children:[!!r&&p(o,{title:p(h,{users:a,noReactionsText:"Nobody likes this yet..."}),enterTouchDelay:0,children:l(s,{"data-testid":"".concat("FeedPo","_likesCounter_").concat(r),className:k.reactionTypographyRoot,variant:"caption",children:["Likes ",r]})}),!!i&&p("span",{onClick:v,children:p(o,{title:p(h,{users:f,noReactionsText:"Nobody commented this yet..."}),enterTouchDelay:0,children:l(s,{"data-testid":"".concat("FeedPo","_commentsCounter_").concat(i),className:k.reactionTypographyRoot,variant:"caption",children:["Comments ",i]})})}),p("div",{"data-testid":"".concat("FeedPo","_activeUsersCounter_").concat(C&&C.length),className:m.cCommentsInfoActiveUsersList,children:C.map((function(e){return g?p(n,{displayName:d(e),imgSrc:e.profile_photo,className:t(k.avatar,k.avatarInList),size:N?25:35},e.id):p(c,{user:e,currentUser:y,children:p(n,{displayName:d(e),imgSrc:e.profile_photo,size:N?25:35,className:t(k.avatar,k.avatarInList)})},e.id)}))})]})},v={reactionTypographyRoot:{color:a[400],margin:"0 8px",cursor:"pointer","&:hover":{textDecoration:"underline"}},avatar:{border:"1px solid #909090"},avatarInList:{marginRight:3,borderWidth:1}};f.propTypes={likesCount:e.number,usersWhoLike:e.arrayOf(e.shape({})),commentsCount:e.number,usersWhoCommented:e.arrayOf(e.string).isRequired,onCommentsClick:e.func,activeUsersList:e.arrayOf(e.shape({})).isRequired,classes:e.shape({}).isRequired,isNative:e.bool,small:e.bool,currentUser:e.shape({})},f.defaultProps={likesCount:0,usersWhoLike:[],commentsCount:0,onCommentsClick:function(){},small:!1,isNative:i,currentUser:{}};var y=r(v)(f);export{y as default};
|