@ludo.ninja/components 2.2.34 → 2.2.35

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.
@@ -32,6 +32,7 @@ const useLikeOpportunity_1 = require("../../api/server-opportunities/mutations/u
32
32
  const vars_1 = require("../../fonts/vars");
33
33
  const heart_svg_1 = __importDefault(require("../../public/cards/heart"));
34
34
  const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
35
+ const useOpenOpportunity_1 = __importDefault(require("../../api/server-opportunities/mutations/useOpenOpportunity"));
35
36
  const SWrapperLink = styled_components_1.default.a `
36
37
  position: relative;
37
38
  background-color: ${colors_1.WhiteColor};
@@ -231,6 +232,7 @@ const OpportunityCard = ({ opportunity, toolsForRemove, }) => {
231
232
  NEXT_PUBLIC_ENV_VALUE: state.NEXT_PUBLIC_ENV_VALUE,
232
233
  }));
233
234
  const { windowDimensions } = (0, screen_1.useWindowDimensionsWithServerInitial)();
235
+ const { openOpportunityAction } = (0, useOpenOpportunity_1.default)();
234
236
  const isMobile = !!(windowDimensions?.windowWidth &&
235
237
  windowDimensions.windowWidth <= ScreenWidth_1.ScreenWidth.DESKTOP);
236
238
  const isSignedIn = (0, store_1.useUserStore)((state) => state.isSignedIn);
@@ -240,8 +242,8 @@ const OpportunityCard = ({ opportunity, toolsForRemove, }) => {
240
242
  }));
241
243
  const getMediaENVDomain = (0, env_1.useEnvStore)((state) => state.getMediaDomain);
242
244
  const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
243
- const opportunityLink = opportunity.opportunityType === 'TOKEN_AIRDROP' ? `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]['app']}/brand/${opportunity.opportunityId}` : (opportunity.shareLink || opportunity.projectUrl || "");
244
- return ((0, jsx_runtime_1.jsxs)(SWrapperLink, { href: opportunityLink, target: "_blank", children: [(0, jsx_runtime_1.jsxs)(StyledCardHead, { children: [(0, jsx_runtime_1.jsx)(OpportunityImage, { alt: opportunity.name, src: opportunity.media
245
+ const opportunityLink = opportunity.opportunityType === 'TOKEN_AIRDROP' ? `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]['app']}/brand/${opportunity.opportunityId}` : (opportunity.projectUrl || opportunity.shareLink || "");
246
+ return ((0, jsx_runtime_1.jsxs)(SWrapperLink, { href: opportunityLink, target: "_blank", onClick: () => openOpportunityAction({ opportunityId: opportunity.opportunityId }), children: [(0, jsx_runtime_1.jsxs)(StyledCardHead, { children: [(0, jsx_runtime_1.jsx)(OpportunityImage, { alt: opportunity.name, src: opportunity.media
245
247
  ? `${getMediaENVDomain()}/opportunity-medias/${opportunity.media}`
246
248
  : "" }), (0, jsx_runtime_1.jsx)(Headicons_1.default, { isMobile: isMobile, onClick: (e) => {
247
249
  e.stopPropagation();
@@ -16,6 +16,7 @@ const CopyIcon_1 = __importDefault(require("./CopyIcon"));
16
16
  const FacebookIcon_1 = __importDefault(require("./FacebookIcon"));
17
17
  const LinkedInIcon_1 = __importDefault(require("./LinkedInIcon"));
18
18
  const LogoXIcon_1 = __importDefault(require("./LogoXIcon"));
19
+ const useCopyOpportunityShareLink_1 = __importDefault(require("../../../api/server-opportunities/mutations/useCopyOpportunityShareLink"));
19
20
  const transitionMain = '200ms cubic-bezier(0.4, 0, 0.2, 1) 0ms';
20
21
  const SWrapper = styled_components_1.default.div `
21
22
  margin: -24px;
@@ -153,9 +154,11 @@ const SWrapper = styled_components_1.default.div `
153
154
  }
154
155
  `;
155
156
  const OpportunityMenu = ({ onClose, opportunity }) => {
157
+ const { copyOpportunityShareLinkAction } = (0, useCopyOpportunityShareLink_1.default)();
156
158
  const opportunityLink = opportunity.shareLink || opportunity?.projectUrl || '';
157
159
  const handleClickMenuItem = (event, item) => {
158
160
  event.stopPropagation();
161
+ copyOpportunityShareLinkAction({ opportunityId: opportunity.opportunityId });
159
162
  if (item.closeOnClick) {
160
163
  onClose();
161
164
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.2.34",
3
+ "version": "2.2.35",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",