frst-components 0.22.91 → 0.22.93
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/dist/index.js
CHANGED
|
@@ -3340,6 +3340,10 @@ const HypothesisComponent = ({ description, type, id, title, votes = [], onVote,
|
|
|
3340
3340
|
React.useEffect(() => {
|
|
3341
3341
|
setHasVoteHypothesis(votes?.some((vote) => vote?.user_uuid === userLoggedId));
|
|
3342
3342
|
}, [votes]);
|
|
3343
|
+
React.useEffect(() => {
|
|
3344
|
+
if (loading)
|
|
3345
|
+
seIsHover(false);
|
|
3346
|
+
}, [loading]);
|
|
3343
3347
|
React.useEffect(() => {
|
|
3344
3348
|
document.addEventListener('mousedown', handleClickOutsideVote);
|
|
3345
3349
|
return () => {
|
|
@@ -3363,20 +3367,22 @@ const HypothesisComponent = ({ description, type, id, title, votes = [], onVote,
|
|
|
3363
3367
|
return (jsxRuntime.jsx(ImageContent$1, { style: { zIndex: 14 - index }, children: jsxRuntime.jsx("img", { src: vote?.user?.avatar || 'https://cdn-images.frstfalconi.cloud/path582.svg' }) }, vote?.id));
|
|
3364
3368
|
}), votes?.length > 2 && (jsxRuntime.jsx(ImageContent$1, { style: { background: '#444444' }, children: jsxRuntime.jsxs("p", { style: {
|
|
3365
3369
|
fontSize: votes?.length > 9 ? 10 : votes?.length > 99 ? 8 : 14
|
|
3366
|
-
}, children: ["+", votes?.length - 2] }) }))] }), votes?.length, " ", votes?.length > 1 ? votesPluralText : votesSingularText] }) }) }), jsxRuntime.jsx(VoteList, { hypothesisVotes: votes, showVotes: showVotesList, viewProfile: handleViewProfile })] })), canVote && hasVoteGoal && votes?.length > 0 && (jsxRuntime.jsx(SplitContainer, {
|
|
3370
|
+
}, children: ["+", votes?.length - 2] }) }))] }), votes?.length, " ", votes?.length > 1 ? votesPluralText : votesSingularText] }) }) }), jsxRuntime.jsx(VoteList, { hypothesisVotes: votes, showVotes: showVotesList, viewProfile: handleViewProfile })] })), canVote && hasVoteGoal && votes?.length > 0 && (jsxRuntime.jsx(SplitContainer, { onClick: () => hasVoteHypothesis && isHover
|
|
3371
|
+
? handleDeleteVote(votes?.find((vote) => vote?.user_uuid === userLoggedId)?.id)
|
|
3372
|
+
: null, children: jsxRuntime.jsx(VoteButtonContainer, { type: type, modeDelete: isHover, height: heightContainer, onMouseEnter: () => seIsHover(true), onMouseLeave: () => seIsHover(false), style: { cursor: hasVoteHypothesis ? 'pointer' : 'default' }, children: hasVoteHypothesis ? (isHover ? (jsxRuntime.jsxs("div", { style: {
|
|
3367
3373
|
display: 'flex',
|
|
3368
3374
|
alignItems: 'center',
|
|
3369
3375
|
gap: '4px',
|
|
3370
3376
|
justifyContent: 'center'
|
|
3371
|
-
},
|
|
3377
|
+
}, children: [jsxRuntime.jsx(ExcludeVoteIcon, { width: "24", height: "24" }), jsxRuntime.jsx(VoteButton, { children: deleteVoteText })] })) : (jsxRuntime.jsxs(VoteCount, { children: [jsxRuntime.jsxs(VoteContent, { children: [votes?.slice(0, 2)?.map((vote, index) => {
|
|
3372
3378
|
return (jsxRuntime.jsx(ImageContent$1, { style: { zIndex: 14 - index }, children: jsxRuntime.jsx("img", { src: vote?.user?.avatar || 'https://cdn-images.frstfalconi.cloud/path582.svg' }) }, vote?.id));
|
|
3373
|
-
}), votes.length > 2 && (jsxRuntime.jsx(ImageContent$1, { style: { background: '#444444' }, children: jsxRuntime.jsxs("p", { children: ["+", votes?.length - 2] }) }))] }), jsxRuntime.jsxs("p", { children: [votes?.length, " ", votes?.length > 1 ? votesPluralText : votesSingularText] })] }))) : (jsxRuntime.jsx(ViewVotes, { hypothesisVotes: votes, votesPluralText: votesPluralText, votesSingularText: votesSingularText })) }) })), canVote && !hasVoteGoal && (jsxRuntime.jsx(SplitContainer, { children: jsxRuntime.jsx(VoteButtonContainer, { type: type, modeDelete: isHover, height: heightContainer, onMouseEnter: () => seIsHover(true), onMouseLeave: () => seIsHover(false), children: jsxRuntime.jsxs("div", { style: {
|
|
3379
|
+
}), votes.length > 2 && (jsxRuntime.jsx(ImageContent$1, { style: { background: '#444444' }, children: jsxRuntime.jsxs("p", { children: ["+", votes?.length - 2] }) }))] }), jsxRuntime.jsxs("p", { children: [votes?.length, " ", votes?.length > 1 ? votesPluralText : votesSingularText] })] }))) : (jsxRuntime.jsx(ViewVotes, { hypothesisVotes: votes, votesPluralText: votesPluralText, votesSingularText: votesSingularText })) }) })), canVote && !hasVoteGoal && (jsxRuntime.jsx(SplitContainer, { onClick: () => handleVote(id), children: jsxRuntime.jsx(VoteButtonContainer, { type: type, modeDelete: isHover, height: heightContainer, onMouseEnter: () => seIsHover(true), onMouseLeave: () => seIsHover(false), children: jsxRuntime.jsxs("div", { style: {
|
|
3374
3380
|
display: 'flex',
|
|
3375
3381
|
alignItems: 'center',
|
|
3376
3382
|
justifyContent: 'center',
|
|
3377
3383
|
paddingLeft: '4px',
|
|
3378
3384
|
height: '100%'
|
|
3379
|
-
},
|
|
3385
|
+
}, children: [jsxRuntime.jsx(VoteIcon, { width: "24", height: "24", style: { marginLeft: '4px', marginRight: '4px' } }), jsxRuntime.jsx(VoteButton, { children: voteText })] }) }) }))] }))] }) }));
|
|
3380
3386
|
};
|
|
3381
3387
|
const VoteList = ({ hypothesisVotes, showVotes, viewProfile }) => {
|
|
3382
3388
|
const sortedVotes = [...hypothesisVotes].sort((a, b) => a.user.name.localeCompare(b.user.name));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hypothesisComponent/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAK9B,eAAO,MAAM,mBAAmB;iBAuBjB,MAAM;UACb,MAAM;QACR,MAAM;WACH,MAAM;WACN,IAAI,EAAE;kBACC,MAAM;2BACG,MAAM,KAAK,GAAG;0BACf,MAAM,KAAK,GAAG;iCACP,MAAM,KAAK,GAAG;cACjC,OAAO;uBACE,OAAO;kBACZ,OAAO;kBACP,OAAO;wBACD,MAAM;sBACR,MAAM;eACb,MAAM;qBACA,MAAM;aACd,MAAM;iBACF,OAAO;eACT,MAAM;cACP,OAAO;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/hypothesisComponent/index.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAK9B,eAAO,MAAM,mBAAmB;iBAuBjB,MAAM;UACb,MAAM;QACR,MAAM;WACH,MAAM;WACN,IAAI,EAAE;kBACC,MAAM;2BACG,MAAM,KAAK,GAAG;0BACf,MAAM,KAAK,GAAG;iCACP,MAAM,KAAK,GAAG;cACjC,OAAO;uBACE,OAAO;kBACZ,OAAO;kBACP,OAAO;wBACD,MAAM;sBACR,MAAM;eACb,MAAM;qBACA,MAAM;aACd,MAAM;iBACF,OAAO;eACT,MAAM;cACP,OAAO;iBAmNlB,CAAA"}
|