|
1 | 1 | import React, { useEffect, useState } from "react"; |
2 | 2 | import { useTranslation } from "react-i18next"; |
3 | 3 | import { Event } from "../../../slices/eventSlice"; |
4 | | -import { Tooltip } from "../../shared/Tooltip"; |
5 | 4 | import ButtonLikeAnchor from "../../shared/ButtonLikeAnchor"; |
6 | 5 | import { enrichPublications } from "../../../thunks/assetsThunks"; |
7 | 6 | import { useAppDispatch } from "../../../store"; |
@@ -76,52 +75,54 @@ const PublishCell = ({ |
76 | 75 | && publications[0].id === 'engage-player'; |
77 | 76 |
|
78 | 77 | return ( |
79 | | - <div className="popover-wrapper"> |
80 | | - {onlyEngage && ( |
81 | | - // <Tooltip title={t("EVENTS.EVENTS.TABLE.TOOLTIP.PLAYER")}> // Disabled due to performance concerns |
82 | | - <a href={publications[0].url} rel="noreferrer" target="_blank"> |
83 | | - <ButtonLikeAnchor> |
84 | | - {t("YES")} |
85 | | - </ButtonLikeAnchor> |
86 | | - </a> |
87 | | - // </Tooltip> |
88 | | - )} |
89 | | - {!onlyEngage && publications.length > 0 && ( |
90 | | - <> |
91 | | - <ButtonLikeAnchor className="popover-wrapper__trigger"> |
92 | | - <span onClick={() => setShowPopup(!showPopup)}>{t("YES")}</span> |
93 | | - </ButtonLikeAnchor> |
94 | | - {showPopup && ( |
95 | | - <div className="js-popover popover" ref={containerPublications}> |
96 | | - <div className="popover__header" /> |
97 | | - <div className="popover__content"> |
98 | | - {/* Show a list item for each publication of an event that isn't hidden*/} |
99 | | - {publications.map((publication, key) => |
100 | | - !publication.hide ? ( |
101 | | - // Check if publications is enabled and choose icon according |
102 | | - publication.enabled ? ( |
103 | | - <a |
104 | | - href={publication.url} |
105 | | - className="popover__list-item" |
106 | | - target="_blank" |
107 | | - rel="noreferrer" |
108 | | - key={key} |
109 | | - > |
110 | | - <span>{publication.label ? t(publication.label as ParseKeys) : t(publication.name as ParseKeys)}</span> |
111 | | - </a> |
112 | | - ) : ( |
113 | | - <ButtonLikeAnchor key={key} className="popover__list-item"> |
114 | | - <span>{publication.label ? t(publication.label as ParseKeys) : t(publication.name as ParseKeys)}</span> |
115 | | - </ButtonLikeAnchor> |
116 | | - ) |
117 | | - ) : null |
118 | | - )} |
119 | | - </div> |
120 | | - </div> |
| 78 | + <> |
| 79 | + { publications.length > 0 && |
| 80 | + <div className="popover-wrapper"> |
| 81 | + {onlyEngage && ( |
| 82 | + // <Tooltip title={t("EVENTS.EVENTS.TABLE.TOOLTIP.PLAYER")}> // Disabled due to performance concerns |
| 83 | + <a className="crosslink" href={publications[0].url} rel="noreferrer" target="_blank"> |
| 84 | + {t("YES")} |
| 85 | + </a> |
| 86 | + // </Tooltip> |
121 | 87 | )} |
122 | | - </> |
123 | | - )} |
124 | | - </div> |
| 88 | + {!onlyEngage && |
| 89 | + <> |
| 90 | + <ButtonLikeAnchor className="popover-wrapper__trigger"> |
| 91 | + <span onClick={() => setShowPopup(!showPopup)}>{t("YES")}</span> |
| 92 | + </ButtonLikeAnchor> |
| 93 | + {showPopup && ( |
| 94 | + <div className="js-popover popover" ref={containerPublications}> |
| 95 | + <div className="popover__header" /> |
| 96 | + <div className="popover__content"> |
| 97 | + {/* Show a list item for each publication of an event that isn't hidden*/} |
| 98 | + {publications.map((publication, key) => |
| 99 | + !publication.hide ? ( |
| 100 | + // Check if publications is enabled and choose icon according |
| 101 | + publication.enabled ? ( |
| 102 | + <a |
| 103 | + href={publication.url} |
| 104 | + className="popover__list-item" |
| 105 | + target="_blank" |
| 106 | + rel="noreferrer" |
| 107 | + key={key} |
| 108 | + > |
| 109 | + <span>{publication.label ? t(publication.label as ParseKeys) : t(publication.name as ParseKeys)}</span> |
| 110 | + </a> |
| 111 | + ) : ( |
| 112 | + <ButtonLikeAnchor key={key} className="popover__list-item"> |
| 113 | + <span>{publication.label ? t(publication.label as ParseKeys) : t(publication.name as ParseKeys)}</span> |
| 114 | + </ButtonLikeAnchor> |
| 115 | + ) |
| 116 | + ) : null |
| 117 | + )} |
| 118 | + </div> |
| 119 | + </div> |
| 120 | + )} |
| 121 | + </> |
| 122 | + } |
| 123 | + </div> |
| 124 | + } |
| 125 | + </> |
125 | 126 | ); |
126 | 127 | }; |
127 | 128 |
|
|
0 commit comments