@ludo.ninja/components 2.3.30 → 2.3.32

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.
@@ -112,7 +112,9 @@ const Sidebar = () => {
112
112
  closeSidebar();
113
113
  redirectToLoginWindow();
114
114
  },
115
- logout: signOut,
115
+ logout: () => {
116
+ signOut(true);
117
+ },
116
118
  }, isAuthorized: isAuthorized, userWallets: wallets, slots: {
117
119
  menu: sideBarData.map(({ title, href, icon, isExternalUrl }) => ((0, jsx_runtime_1.jsxs)(SLink, { href: href, target: isExternalUrl ? "_blank" : "_self", onClick: closeSidebar, passHref: isExternalUrl, scale: (0, scale_1.getAdaptiveScale)({ windowDimensions, currentSize: 1 }), children: [(0, jsx_runtime_1.jsx)("span", { className: "icon-wrapper", children: icon }), title] }, title))),
118
120
  userPicture: ({ children, height, width, isNeedBoxTransform }) => ((0, jsx_runtime_1.jsx)(Userpic_1.default, { width: width, height: height, userId: userId, isNeedBoxTransform: isNeedBoxTransform, children: children })),
@@ -111,7 +111,9 @@ const SidebarSpa = ({ SLink, UserPic, SidebarInviteCodeLabel, }) => {
111
111
  closeSidebar();
112
112
  redirectToLoginWindow();
113
113
  },
114
- logout: signOut,
114
+ logout: () => {
115
+ signOut(true);
116
+ },
115
117
  }, isAuthorized: isAuthorized, userWallets: wallets, slots: {
116
118
  menu: sideBarData.map(({ title, href, icon, isExternalUrl }) => ((0, jsx_runtime_1.jsxs)(SLink, { href: href, target: isExternalUrl ? "_blank" : "_self", onClick: closeSidebar, passHref: isExternalUrl, scale: (0, scale_1.getAdaptiveScale)({ windowDimensions, currentSize: 1 }), children: [(0, jsx_runtime_1.jsx)("span", { className: "icon-wrapper", children: icon }), title] }, title))),
117
119
  userPicture: ({ children, height, width, isNeedBoxTransform }) => ((0, jsx_runtime_1.jsx)(UserPic, { width: width, height: height, userId: userId, isNeedBoxTransform: isNeedBoxTransform, children: children })),
@@ -21,11 +21,13 @@ const ScreenWidth_1 = require("../../styles/ScreenWidth");
21
21
  const colors_1 = require("../../styles/colors");
22
22
  const boxTransform_1 = __importDefault(require("../../styles/mixins/boxTransform"));
23
23
  const typography_1 = require("../../styles/typography");
24
+ const MainButton_1 = __importDefault(require("../../system/Buttons/MainButton"));
24
25
  const CardCategory_1 = __importDefault(require("../../system/Cards/CardContent/CardCategory"));
25
26
  const Headicons_1 = __importDefault(require("../../system/Cards/Styles/Headicons"));
26
27
  const ImageInterceptor_1 = require("../../system/Img/ImageInterceptor");
27
28
  const index_1 = require("../../system/index");
28
29
  const screen_1 = require("../../utils/screen");
30
+ const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema");
29
31
  const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
30
32
  const colors_2 = require("@ludo.ninja/ui/build/styles/colors");
31
33
  const boxShadow_1 = __importDefault(require("@ludo.ninja/ui/build/styles/mixins/boxShadow"));
@@ -144,6 +146,7 @@ const StyledCardContent = styled_components_1.default.div `
144
146
  display: inline-flex;
145
147
  justify-content: space-between;
146
148
  flex-wrap: wrap;
149
+
147
150
  .participantsCount {
148
151
  color: ${colors_1.TextGrayColor};
149
152
  ${typography_1.FH6}
@@ -249,18 +252,21 @@ const OpportunityCard = ({ opportunity, toolsForRemove, }) => {
249
252
  const getMediaENVDomain = (0, env_1.useEnvStore)((state) => state.getMediaDomain);
250
253
  const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
251
254
  const opportunityLink = opportunity.opportunityType === "TOKEN_AIRDROP"
252
- // ? `${ludoDomains[NEXT_PUBLIC_ENV_VALUE as TEnvValue]["app"]}/brand/${opportunity.opportunityId}`
253
- ? `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["welcome"]}/${opportunity.projectSlug === 'tico' ? 'funtico' : opportunity.projectSlug}` || ''
255
+ ? // ? `${ludoDomains[NEXT_PUBLIC_ENV_VALUE as TEnvValue]["app"]}/brand/${opportunity.opportunityId}`
256
+ `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["welcome"]}/${opportunity.projectSlug === "tico" ? "funtico" : opportunity.projectSlug}` || ""
254
257
  : opportunity.projectUrl || opportunity.shareLink || "";
255
- const isShowParticipantsCount = typeof opportunity.availablePlacesForAirdrop === 'number' && typeof opportunity.participantsLimit === 'number';
256
- const sanitizedHtml = (0, sanitize_html_1.default)(opportunity?.description || '', {
257
- allowedTags: ['b', 'i', 'em', 'strong', 'br', 'div'],
258
+ const isShowParticipantsCount = typeof opportunity.availablePlacesForAirdrop === "number" && typeof opportunity.participantsLimit === "number";
259
+ const isAirdrop = opportunity.opportunityType === schema_1.IOpportunityType.TokenAirdrop;
260
+ const sanitizedHtml = (0, sanitize_html_1.default)(opportunity?.description || "", {
261
+ allowedTags: ["b", "i", "em", "strong", "br", "div"],
258
262
  });
259
263
  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 ? `${getMediaENVDomain()}/opportunity-medias/${opportunity.media}` : "" }), (0, jsx_runtime_1.jsx)(Headicons_1.default, { isMobile: isMobile, onClick: (e) => {
260
264
  e.stopPropagation();
261
265
  e.preventDefault();
262
266
  }, children: (0, jsx_runtime_1.jsxs)("div", { className: "icons", children: [(0, jsx_runtime_1.jsx)("div", { className: "icon", onClick: () => {
263
267
  openModalSidebarPortal((0, jsx_runtime_1.jsx)(OpportunityMenu_1.OpportunityMenu, { opportunity: opportunity, onClose: closeModalSidebarPortal }));
264
- }, children: (0, jsx_runtime_1.jsx)(ShareIcon_1.ShareIcon, {}) }), !isProd() && ((0, jsx_runtime_1.jsx)(OpportunityLike, { isDefaultLiked: !!(isSignedIn && opportunity.liked), opportunityId: opportunity.opportunityId, toolsForRemove: toolsForRemove }))] }) })] }), (0, jsx_runtime_1.jsxs)(StyledCardContent, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "cardContent", children: [(0, jsx_runtime_1.jsxs)("div", { className: "cardContentWrapper", children: [(0, jsx_runtime_1.jsx)("p", { className: `secondName`, children: opportunity.name }), (0, jsx_runtime_1.jsx)("p", { className: `mainName`, dangerouslySetInnerHTML: { __html: sanitizedHtml } }), (0, jsx_runtime_1.jsxs)("p", { className: `categoryName`, children: [opportunity.categoryName, isShowParticipantsCount && (0, jsx_runtime_1.jsx)("span", { className: 'participantsCount', children: `Free spots left: ${opportunity.availablePlacesForAirdrop}` })] })] }), (0, jsx_runtime_1.jsx)(OpportunityDropDown_1.OpportunityDropDown, { opportunity: opportunity })] }), (0, jsx_runtime_1.jsxs)(index_1.Flex, { alignItems: "end", justifyContent: "space-between", className: `categoryFooter`, children: [(0, jsx_runtime_1.jsx)(CardCategory_1.default, { label: data_1.default[opportunity.opportunityType] || data_1.default.opportunity }), opportunity.activeUntil && ((0, jsx_runtime_1.jsx)("div", { className: "date", children: `till ${(0, moment_1.default)(opportunity.activeUntil).format("LL")}` }))] })] })] }));
268
+ }, children: (0, jsx_runtime_1.jsx)(ShareIcon_1.ShareIcon, {}) }), !isProd() && ((0, jsx_runtime_1.jsx)(OpportunityLike, { isDefaultLiked: !!(isSignedIn && opportunity.liked), opportunityId: opportunity.opportunityId, toolsForRemove: toolsForRemove }))] }) })] }), (0, jsx_runtime_1.jsxs)(StyledCardContent, { children: [(0, jsx_runtime_1.jsxs)("div", { className: "cardContent", children: [(0, jsx_runtime_1.jsxs)("div", { className: "cardContentWrapper", children: [(0, jsx_runtime_1.jsx)("p", { className: `secondName`, children: opportunity.name }), (0, jsx_runtime_1.jsx)("p", { className: `mainName`, dangerouslySetInnerHTML: { __html: sanitizedHtml } }), (0, jsx_runtime_1.jsx)("p", { className: `categoryName`, children: opportunity.categoryName })] }), (0, jsx_runtime_1.jsx)(OpportunityDropDown_1.OpportunityDropDown, { opportunity: opportunity })] }), (0, jsx_runtime_1.jsxs)(index_1.Flex, { alignItems: "end", justifyContent: "space-between", className: `categoryFooter`, children: [(0, jsx_runtime_1.jsx)(CardCategory_1.default, { label: data_1.default[opportunity.opportunityType] || data_1.default.opportunity }), isAirdrop && !opportunity.subscribed ? ((0, jsx_runtime_1.jsx)(MainButton_1.default, { style: { borderRadius: "6px" }, variant: "primaryXS", text: "Claim", onClick: () => {
269
+ window.location.replace(opportunityLink);
270
+ } })) : (opportunity.activeUntil && ((0, jsx_runtime_1.jsx)("div", { className: "date", children: `till ${(0, moment_1.default)(opportunity.activeUntil).format("LL")}` })))] })] })] }));
265
271
  };
266
272
  exports.OpportunityCard = OpportunityCard;
@@ -1,2 +1,2 @@
1
1
  import { opportunitiesSchema } from '@ludo.ninja/api';
2
- export type TOpportunity = Pick<opportunitiesSchema.IOpportunityV2, 'opportunityId' | 'projectId' | 'categoryId' | 'opportunityStatus' | 'opportunityType' | 'notificationType' | 'name' | 'description' | 'projectBlockchain' | 'projectContract' | 'projectName' | 'projectSlug' | 'categoryName' | 'ludoUrl' | 'projectUrl' | 'activeFrom' | 'activeUntil' | 'minXpLevel' | 'maxXpLevel' | 'minRank' | 'maxRank' | 'media' | 'reportLink' | 'clicks' | 'views' | 'blockchain' | 'collection' | 'createdAt' | 'minWalletValue' | 'maxWalletValue' | 'shareLink' | 'liked' | 'participantsLimit' | 'availablePlacesForAirdrop'>;
2
+ export type TOpportunity = Pick<opportunitiesSchema.IOpportunityV2, 'opportunityId' | 'projectId' | 'categoryId' | 'opportunityStatus' | 'opportunityType' | 'notificationType' | 'name' | 'description' | 'projectBlockchain' | 'projectContract' | 'projectName' | 'projectSlug' | 'categoryName' | 'ludoUrl' | 'projectUrl' | 'activeFrom' | 'activeUntil' | 'minXpLevel' | 'maxXpLevel' | 'minRank' | 'maxRank' | 'media' | 'reportLink' | 'clicks' | 'views' | 'blockchain' | 'collection' | 'createdAt' | 'minWalletValue' | 'maxWalletValue' | 'shareLink' | 'liked' | 'participantsLimit' | 'availablePlacesForAirdrop' | 'subscribed'>;
@@ -33,7 +33,7 @@ const useSignOut = () => {
33
33
  setUser(null);
34
34
  // when invite code is not required = no redirect
35
35
  // window.location.replace(ludoDomains[NEXT_PUBLIC_ENV_VALUE as TEnvValue]["welcome"]);
36
- if (includeRedirect && window.location.origin === ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["account"]) {
36
+ if (includeRedirect) {
37
37
  window.location.replace(ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["welcome"]);
38
38
  }
39
39
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.3.30",
3
+ "version": "2.3.32",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",