frst-components 0.22.90 → 0.22.92
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
|
@@ -3339,6 +3339,7 @@ const HypothesisComponent = ({ description, type, id, title, votes = [], onVote,
|
|
|
3339
3339
|
};
|
|
3340
3340
|
React.useEffect(() => {
|
|
3341
3341
|
setHasVoteHypothesis(votes?.some((vote) => vote?.user_uuid === userLoggedId));
|
|
3342
|
+
seIsHover(false);
|
|
3342
3343
|
}, [votes]);
|
|
3343
3344
|
React.useEffect(() => {
|
|
3344
3345
|
document.addEventListener('mousedown', handleClickOutsideVote);
|
|
@@ -3354,18 +3355,10 @@ const HypothesisComponent = ({ description, type, id, title, votes = [], onVote,
|
|
|
3354
3355
|
}
|
|
3355
3356
|
}, [ContainerRef]);
|
|
3356
3357
|
const handleVote = async (hyphoteseId) => {
|
|
3357
|
-
|
|
3358
|
-
if (vote?.status === 201) {
|
|
3359
|
-
setHasVoteHypothesis(true);
|
|
3360
|
-
}
|
|
3361
|
-
if (vote?.status !== 201)
|
|
3362
|
-
setHasVoteHypothesis(false);
|
|
3358
|
+
await onVote(hyphoteseId);
|
|
3363
3359
|
};
|
|
3364
3360
|
const handleDeleteVote = async (voteId) => {
|
|
3365
|
-
|
|
3366
|
-
if (vote?.status === 204) {
|
|
3367
|
-
setHasVoteHypothesis(false);
|
|
3368
|
-
}
|
|
3361
|
+
await deleteVote(voteId);
|
|
3369
3362
|
};
|
|
3370
3363
|
return (jsxRuntime.jsx(MainContainer, { children: jsxRuntime.jsxs(Container$l, { type: type, id: id, ref: ContainerRef, children: [jsxRuntime.jsxs(SplitContainer, { children: [showAvatar && (jsxRuntime.jsx(Avatar, { src: avatar, size: "24px", style: { marginRight: '8px', cursor: authorId ? 'pointer' : 'default' }, onClick: () => handleViewProfile(authorId) })), jsxRuntime.jsx(Title$6, { children: title }), jsxRuntime.jsx(Separator, { children: "|" }), jsxRuntime.jsx(Description$3, { children: description })] }), loading && (jsxRuntime.jsx(SplitContainer, { children: jsxRuntime.jsx(VoteButtonContainer, { type: type, modeDelete: isHover, height: heightContainer, style: { cursor: 'default' }, children: jsxRuntime.jsx(Loading, {}) }) })), !loading && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [!canVote && canViewVote && votes?.length > 0 && (jsxRuntime.jsxs("div", { style: { position: 'relative', height: '100%' }, children: [jsxRuntime.jsx(SplitContainer, { children: jsxRuntime.jsx(VoteButtonContainer, { ref: viewVotesRef, height: heightContainer, style: { cursor: canViewListVotes ? 'pointer' : 'default' }, type: type, onClick: canViewListVotes ? toggleVotes : null, children: jsxRuntime.jsxs(VoteCount, { children: [jsxRuntime.jsxs(VoteContent, { children: [votes?.slice(0, 2)?.map((vote, index) => {
|
|
3371
3364
|
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));
|
|
@@ -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;iBA4MlB,CAAA"}
|