@ludo.ninja/components 2.3.9 → 2.3.11
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.
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const useGetOpportunities: (availableProfileId: string) => {
|
|
2
|
-
opportunities: import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").Maybe<Pick<import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").IOpportunityV2, "views" | "createdAt" | "shareLink" | "blockchain" | "name" | "description" | "collection" | "liked" | "opportunityId" | "brandId" | "categoryId" | "opportunityStatus" | "opportunityType" | "notificationType" | "brandName" | "brandDescription" | "brandMedia" | "brandUrl" | "brandIndustry" | "categoryName" | "ludoUrl" | "projectUrl" | "activeFrom" | "activeUntil" | "minXpLevel" | "maxXpLevel" | "minRank" | "maxRank" | "media" | "reportLink" | "clicks" | "minWalletValue" | "maxWalletValue" | "participantsLimit" | "availablePlacesForAirdrop">>[];
|
|
2
|
+
opportunities: import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").Maybe<Pick<import("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema").IOpportunityV2, "views" | "createdAt" | "shareLink" | "blockchain" | "name" | "description" | "collection" | "liked" | "opportunityId" | "brandId" | "categoryId" | "opportunityStatus" | "opportunityType" | "notificationType" | "brandName" | "brandDescription" | "brandMedia" | "brandUrl" | "brandIndustry" | "categoryName" | "ludoUrl" | "projectUrl" | "activeFrom" | "activeUntil" | "minXpLevel" | "maxXpLevel" | "minRank" | "maxRank" | "media" | "reportLink" | "clicks" | "minWalletValue" | "maxWalletValue" | "participantsLimit" | "availablePlacesForAirdrop" | "brandLudoUrl">>[];
|
|
3
3
|
isLoadingOpportunities: boolean;
|
|
4
4
|
};
|
|
@@ -26,13 +26,13 @@ const Headicons_1 = __importDefault(require("../../system/Cards/Styles/Headicons
|
|
|
26
26
|
const ImageInterceptor_1 = require("../../system/Img/ImageInterceptor");
|
|
27
27
|
const index_1 = require("../../system/index");
|
|
28
28
|
const screen_1 = require("../../utils/screen");
|
|
29
|
-
const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
|
|
30
29
|
const colors_2 = require("@ludo.ninja/ui/build/styles/colors");
|
|
31
30
|
const boxShadow_1 = __importDefault(require("@ludo.ninja/ui/build/styles/mixins/boxShadow"));
|
|
32
31
|
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
33
32
|
const moment_1 = __importDefault(require("moment/moment"));
|
|
34
33
|
const react_1 = require("react");
|
|
35
34
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
35
|
+
const sanitize_html_1 = __importDefault(require("sanitize-html"));
|
|
36
36
|
const SWrapperLink = styled_components_1.default.a `
|
|
37
37
|
position: relative;
|
|
38
38
|
background-color: ${colors_2.WhiteColor};
|
|
@@ -248,14 +248,18 @@ const OpportunityCard = ({ opportunity, toolsForRemove, }) => {
|
|
|
248
248
|
const getMediaENVDomain = (0, env_1.useEnvStore)((state) => state.getMediaDomain);
|
|
249
249
|
const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
|
|
250
250
|
const opportunityLink = opportunity.opportunityType === "TOKEN_AIRDROP"
|
|
251
|
-
? `${
|
|
251
|
+
// ? `${ludoDomains[NEXT_PUBLIC_ENV_VALUE as TEnvValue]["app"]}/brand/${opportunity.opportunityId}`
|
|
252
|
+
? opportunity.brandLudoUrl || ''
|
|
252
253
|
: opportunity.projectUrl || opportunity.shareLink || "";
|
|
253
254
|
const isShowParticipantsCount = typeof opportunity.availablePlacesForAirdrop === 'number' && typeof opportunity.participantsLimit === 'number';
|
|
255
|
+
const sanitizedHtml = (0, sanitize_html_1.default)(opportunity?.description || '', {
|
|
256
|
+
allowedTags: ['b', 'i', 'em', 'strong', 'br', 'div'],
|
|
257
|
+
});
|
|
254
258
|
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) => {
|
|
255
259
|
e.stopPropagation();
|
|
256
260
|
e.preventDefault();
|
|
257
261
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "icons", children: [(0, jsx_runtime_1.jsx)("div", { className: "icon", onClick: () => {
|
|
258
262
|
openModalSidebarPortal((0, jsx_runtime_1.jsx)(OpportunityMenu_1.OpportunityMenu, { opportunity: opportunity, onClose: closeModalSidebarPortal }));
|
|
259
|
-
}, 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`,
|
|
263
|
+
}, 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: `${opportunity.availablePlacesForAirdrop}/${opportunity.participantsLimit}` })] })] }), (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")}` }))] })] })] }));
|
|
260
264
|
};
|
|
261
265
|
exports.OpportunityCard = OpportunityCard;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { opportunitiesSchema } from '@ludo.ninja/api';
|
|
2
|
-
export type TOpportunity = Pick<opportunitiesSchema.IOpportunityV2, 'opportunityId' | 'brandId' | 'categoryId' | 'opportunityStatus' | 'opportunityType' | 'notificationType' | 'name' | 'description' | 'brandName' | 'brandDescription' | 'brandMedia' | 'brandUrl' | 'brandIndustry' | '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' | 'brandId' | 'categoryId' | 'opportunityStatus' | 'opportunityType' | 'notificationType' | 'name' | 'description' | 'brandName' | 'brandDescription' | 'brandMedia' | 'brandUrl' | 'brandIndustry' | 'categoryName' | 'ludoUrl' | 'projectUrl' | 'activeFrom' | 'activeUntil' | 'minXpLevel' | 'maxXpLevel' | 'minRank' | 'maxRank' | 'media' | 'reportLink' | 'clicks' | 'views' | 'blockchain' | 'collection' | 'createdAt' | 'minWalletValue' | 'maxWalletValue' | 'shareLink' | 'liked' | 'participantsLimit' | 'availablePlacesForAirdrop' | 'brandLudoUrl'>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ludo.ninja/components",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.11",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -52,6 +52,7 @@
|
|
|
52
52
|
"react-hyphen": "^1.4.0",
|
|
53
53
|
"react-loading-skeleton": "^3.1.1",
|
|
54
54
|
"react-player": "^2.12.0",
|
|
55
|
+
"sanitize-html": "^2.14.0",
|
|
55
56
|
"react-select": "^5.7.2",
|
|
56
57
|
"react-share": "^4.4.1",
|
|
57
58
|
"react-slick": "^0.29.0",
|
|
@@ -88,6 +89,7 @@
|
|
|
88
89
|
"@types/react-window-infinite-loader": "^1.0.6",
|
|
89
90
|
"@types/styled-components": "^5.1.26",
|
|
90
91
|
"@types/styled-system": "^5.1.16",
|
|
92
|
+
"@types/sanitize-html": "^2.13.0",
|
|
91
93
|
"@typescript-eslint/eslint-plugin": "^5.43.0",
|
|
92
94
|
"cross-env": "^7.0.3",
|
|
93
95
|
"eslint": "8.31.0",
|