@ludo.ninja/components 2.3.1 → 2.3.3
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/README.md
ADDED
|
@@ -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">>[];
|
|
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">>[];
|
|
3
3
|
isLoadingOpportunities: boolean;
|
|
4
4
|
};
|
|
@@ -182,6 +182,12 @@ const StyledCardContent = styled_components_1.default.div `
|
|
|
182
182
|
line-height: ${(0, _4k_1.adaptiveValueCalc)(16)};
|
|
183
183
|
margin-top: ${(0, _4k_1.adaptiveValueCalc)(12)};
|
|
184
184
|
}
|
|
185
|
+
|
|
186
|
+
.participantsCount {
|
|
187
|
+
display: inline-flex;
|
|
188
|
+
justify-content: space-between;
|
|
189
|
+
flex-wrap: wrap;
|
|
190
|
+
}
|
|
185
191
|
}
|
|
186
192
|
}
|
|
187
193
|
|
|
@@ -243,11 +249,12 @@ const OpportunityCard = ({ opportunity, toolsForRemove, }) => {
|
|
|
243
249
|
const opportunityLink = opportunity.opportunityType === "TOKEN_AIRDROP"
|
|
244
250
|
? `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/brand/${opportunity.opportunityId}`
|
|
245
251
|
: opportunity.projectUrl || opportunity.shareLink || "";
|
|
252
|
+
const isShowParticipantsCount = typeof opportunity.availablePlacesForAirdrop === 'number' && typeof opportunity.participantsLimit === 'number';
|
|
246
253
|
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) => {
|
|
247
254
|
e.stopPropagation();
|
|
248
255
|
e.preventDefault();
|
|
249
256
|
}, children: (0, jsx_runtime_1.jsxs)("div", { className: "icons", children: [(0, jsx_runtime_1.jsx)("div", { className: "icon", onClick: () => {
|
|
250
257
|
openModalSidebarPortal((0, jsx_runtime_1.jsx)(OpportunityMenu_1.OpportunityMenu, { opportunity: opportunity, onClose: closeModalSidebarPortal }));
|
|
251
|
-
}, 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`, children: opportunity.description }), (0, jsx_runtime_1.
|
|
258
|
+
}, 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`, children: opportunity.description }), (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")}` }))] })] })] }));
|
|
252
259
|
};
|
|
253
260
|
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'>;
|
|
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'>;
|