@ludo.ninja/components 2.2.9 → 2.2.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
- export declare const useGetOpportunities: () => {
1
+ export declare const useGetOpportunities: (availableProfileId: string) => {
2
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" | "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" | "shareLink">>[];
3
3
  isLoadingOpportunities: boolean;
4
4
  };
@@ -1,14 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useGetOpportunities = void 0;
4
+ const store_1 = require("../../../modules/user/store");
5
+ const ui_1 = require("../../../store/ui");
4
6
  const api_1 = require("@ludo.ninja/api");
5
7
  const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/opportunitiesHost/schema");
6
8
  const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
7
- const ui_1 = require("../../../store/ui");
8
- const store_1 = require("../../../modules/user/store");
9
9
  const react_1 = require("react");
10
- const useGetOpportunities = () => {
10
+ const useGetOpportunities = (availableProfileId) => {
11
11
  const isSignedIn = (0, store_1.useUserStore)((state) => state.isSignedIn);
12
+ const user = (0, store_1.useUserStore)((state) => state.user);
12
13
  const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
13
14
  const [opportunities, setOpportunities] = (0, react_1.useState)([]);
14
15
  const [getOpportunities, { loading }] = (0, schema_1.useFetchOpportunitiesForProfileLazyQuery)({
@@ -23,7 +24,7 @@ const useGetOpportunities = () => {
23
24
  },
24
25
  });
25
26
  (0, react_1.useEffect)(() => {
26
- if (isSignedIn && !opportunities.length) {
27
+ if (isSignedIn && !opportunities.length && availableProfileId === user?.userId) {
27
28
  getOpportunities().then((res) => {
28
29
  setOpportunities(res.data?.fetchOpportunitiesForProfile || []);
29
30
  });
@@ -1,7 +1,7 @@
1
- import { ReactNode } from "react";
2
- import { searchSchema as schema } from "@ludo.ninja/api";
3
1
  import GalleryEntityV2 from '../../../dto/GalleryEntityV2';
4
2
  import { TCreationAndCollection } from '../../../modules/virtuoso/types';
3
+ import { searchSchema as schema } from "@ludo.ninja/api";
4
+ import { ReactNode } from "react";
5
5
  export type RemoveToolsType = {
6
6
  gallery?: GalleryEntityV2;
7
7
  removeFn: (itemType: "asset" | "collection") => void;
@@ -28,26 +28,26 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
28
28
  Object.defineProperty(exports, "__esModule", { value: true });
29
29
  exports.CreationCard = void 0;
30
30
  const jsx_runtime_1 = require("react/jsx-runtime");
31
- const react_1 = __importDefault(require("react"));
32
- const link_1 = __importDefault(require("next/link"));
33
- const react_loading_skeleton_1 = __importDefault(require("react-loading-skeleton"));
34
- const styled_components_1 = __importStar(require("styled-components"));
35
- const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
31
+ const ItemType_1 = require("../../../dto/common/ItemType");
32
+ const likes_1 = __importDefault(require("../../../hooks/likes"));
36
33
  const env_1 = require("../../../store/env");
37
34
  const ScreenWidth_1 = require("../../../styles/ScreenWidth");
38
35
  const colors_1 = require("../../../styles/colors");
39
36
  const boxShadow_1 = __importDefault(require("../../../styles/mixins/boxShadow"));
40
37
  const boxTransform_1 = __importDefault(require("../../../styles/mixins/boxTransform"));
41
- const index_1 = require("../../index");
42
38
  const CardContent_1 = __importDefault(require("../CardContent"));
43
39
  const CardCategory_1 = __importDefault(require("../CardContent/CardCategory"));
44
40
  const CardLikes_1 = __importDefault(require("../CardContent/CardLikes"));
45
41
  const CardHead_1 = require("./CardHead");
46
42
  const Head_1 = __importDefault(require("../Styles/Head"));
47
43
  const Headicons_1 = __importDefault(require("../Styles/Headicons"));
48
- const likes_1 = __importDefault(require("../../../hooks/likes"));
49
- const ItemType_1 = require("../../../dto/common/ItemType");
44
+ const index_1 = require("../../index");
50
45
  const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
46
+ const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
47
+ const link_1 = __importDefault(require("next/link"));
48
+ const react_1 = __importDefault(require("react"));
49
+ const react_loading_skeleton_1 = __importDefault(require("react-loading-skeleton"));
50
+ const styled_components_1 = __importStar(require("styled-components"));
51
51
  // Styles
52
52
  const StyledRegularCard = styled_components_1.default.div `
53
53
  position: relative;
@@ -55,23 +55,23 @@ const StyledRegularCard = styled_components_1.default.div `
55
55
  border-radius: 6px;
56
56
  ${boxShadow_1.default};
57
57
  ${boxTransform_1.default};
58
- // ${(props) => (props.isNeedTransform ? null : boxTransform_1.default)}
58
+ // ${(props) => (props.isNeedTransform ? null : boxTransform_1.default)}
59
59
 
60
60
  min-height: ${(props) => (props.isNeedHeight ? "346px" : "")};
61
61
 
62
62
  ${(props) => props.isShowCheckbox
63
63
  ? (0, styled_components_1.css) `
64
- ${Headicons_1.default} {
65
- transition: 0.2s opacity ease-in;
66
- opacity: 1 !important;
67
- }
68
- `
64
+ ${Headicons_1.default} {
65
+ transition: 0.2s opacity ease-in;
66
+ opacity: 1 !important;
67
+ }
68
+ `
69
69
  : (0, styled_components_1.css) `
70
- &:hover ${Headicons_1.default} {
71
- transition: 0.2s opacity ease-in;
72
- opacity: 1 !important;
73
- }
74
- `}
70
+ &:hover ${Headicons_1.default} {
71
+ transition: 0.2s opacity ease-in;
72
+ opacity: 1 !important;
73
+ }
74
+ `}
75
75
  .linkRegularCard {
76
76
  display: flex;
77
77
  height: 100%;
@@ -91,7 +91,7 @@ const StyledRegularCard = styled_components_1.default.div `
91
91
  ${ScreenWidth_1.mediaQuery.minWidthFourK} {
92
92
  border-radius: ${(0, _4k_1.adaptiveValueCalc)(6)};
93
93
 
94
- min-height: ${(props) => props.isNeedHeight ? (0, _4k_1.adaptiveValueCalc)(346) : ""};
94
+ min-height: ${(props) => (props.isNeedHeight ? (0, _4k_1.adaptiveValueCalc)(346) : "")};
95
95
  }
96
96
  `;
97
97
  // Component
@@ -123,7 +123,7 @@ const CreationCard = ({ creationName, creation, isNeedHeight, likesDynamicInfo,
123
123
  // } else {
124
124
  // window.open(`${domain}/rewards/${userId}`,'_self');
125
125
  // }
126
- return ((0, jsx_runtime_1.jsxs)(StyledRegularCard, { isNeedHeight: isNeedHeight, isNeedTransform: isNeedShowMoreButton, isShowCheckbox: isShowCheckbox, children: [isShowCheckbox && checkboxSlot, (0, jsx_runtime_1.jsxs)(HideLink, { className: "linkRegularCard", href: getLink(creation.getCreationLink()), children: [(0, jsx_runtime_1.jsxs)(Head_1.default, { children: [creation.detectMediaType().displaySingleMedia(), (0, jsx_runtime_1.jsx)(CardHead_1.CardHead, { isRegularCard: !!isRegularCard, isIconLiked: likes.isLiked, creation: creation, addLikeToCard: addLike, deleteLikeFromCard: deleteLike, isUserProfile: isUserProfile || false, isDisabled: !!isLoadingLikes, isShowCheckbox: isShowCheckbox, currentMyGalleryId: currentMyGalleryId })] }), (0, jsx_runtime_1.jsx)(CardContent_1.default, { creationName: creationName, firstName: creation.getCreatorAddress(), secondName: creation.getName(), cuttedSecondName: creation.getCuttedSecondName(!isMobile), itemId: creation.getItemId(), isNeedShowMoreButton: isHideProd ? false : !!isNeedShowMoreButton, href: getLink(creation.getCreationLink()), children: (0, jsx_runtime_1.jsxs)(index_1.Flex, { alignItems: "end", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(CardCategory_1.default, { label: creation.getLabel() }), isHideProd &&
126
+ return ((0, jsx_runtime_1.jsxs)(StyledRegularCard, { isNeedHeight: isNeedHeight, isNeedTransform: isNeedShowMoreButton, isShowCheckbox: isShowCheckbox, children: [isShowCheckbox && checkboxSlot, (0, jsx_runtime_1.jsxs)(HideLink, { className: "linkRegularCard", href: getLink(creation.getCreationLink()), children: [(0, jsx_runtime_1.jsxs)(Head_1.default, { children: [creation.detectMediaType().displaySingleMedia(), (0, jsx_runtime_1.jsx)(CardHead_1.CardHead, { isRegularCard: !!isRegularCard, isIconLiked: likes.isLiked, creation: creation, addLikeToCard: addLike, deleteLikeFromCard: deleteLike, isUserProfile: isUserProfile || false, isDisabled: !!isLoadingLikes, isShowCheckbox: isShowCheckbox, currentMyGalleryId: currentMyGalleryId })] }), (0, jsx_runtime_1.jsx)(CardContent_1.default, { creationName: creationName, firstName: creation.getCreatorAddress(), secondName: creation.getName(), cuttedSecondName: creation.getCuttedSecondName(!isMobile), itemId: creation.getItemId(), isNeedShowMoreButton: isHideProd ? false : !!isNeedShowMoreButton, href: getLink(creation.getCreationLink()), children: (0, jsx_runtime_1.jsxs)(index_1.Flex, { alignItems: "end", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(CardCategory_1.default, { label: creation.getLabel() }), !isHideProd &&
127
127
  (isLoadingLikes ? ((0, jsx_runtime_1.jsx)(react_loading_skeleton_1.default, { style: { borderRadius: "3px" }, height: "100%", width: "30px" })) : ((0, jsx_runtime_1.jsx)(CardLikes_1.default, { isLiked: likes.isLiked, likes: likes.likesCount })))] }) })] })] }));
128
128
  };
129
129
  exports.CreationCard = CreationCard;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.2.9",
3
+ "version": "2.2.11",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",