@ludo.ninja/components 2.2.36 → 2.2.38

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.
Files changed (92) hide show
  1. package/build/api/server-galleries/queries/useFetchGallery/index.d.ts +5 -5
  2. package/build/api/server-galleries/queries/useFetchGallery/index.js +5 -8
  3. package/build/api/server-galleries/queries/useFetchMyFavorites/index.d.ts +3 -3
  4. package/build/api/server-galleries/queries/useFetchMyFavorites/index.js +5 -11
  5. package/build/api/server-galleries/queries/useFetchMyGalleries/index.d.ts +3 -3
  6. package/build/api/server-galleries/queries/useFetchMyGalleries/index.js +5 -11
  7. package/build/api/server-galleries/queries/useFetchUserFavorites/index.d.ts +4 -4
  8. package/build/api/server-galleries/queries/useFetchUserFavorites/index.js +6 -9
  9. package/build/api/server-search/queries/useFetchAllCreations/index.d.ts +7 -7
  10. package/build/api/server-search/queries/useFetchAllCreations/index.js +7 -10
  11. package/build/api/server-search/queries/useFetchCollections/index.d.ts +6 -6
  12. package/build/api/server-search/queries/useFetchCollections/index.js +10 -12
  13. package/build/api/server-search/queries/useFetchDynamicCollectionData/index.d.ts +4 -4
  14. package/build/api/server-search/queries/useFetchDynamicCollectionData/index.js +8 -11
  15. package/build/api/server-search/queries/useFindCreations/index.d.ts +7 -7
  16. package/build/api/server-search/queries/useFindCreations/index.js +9 -12
  17. package/build/api/server-search/queries/useFindUserCreations/index.d.ts +3 -3
  18. package/build/api/server-search/queries/useFindUserCreations/index.js +7 -10
  19. package/build/api/server-search/queries/useFindUserLudoCreations/index.d.ts +3 -3
  20. package/build/api/server-search/queries/useFindUserLudoCreations/index.js +7 -10
  21. package/build/components/assetPage/assetLikes/index.js +7 -7
  22. package/build/components/gallery/add/addCreationToGallery/index.js +7 -7
  23. package/build/components/search/searchSuggestions/index.js +2 -2
  24. package/build/dto/AssetEntity/index.d.ts +3 -3
  25. package/build/dto/AssetEntity/index.js +16 -33
  26. package/build/dto/AssetSearchEntity/index.d.ts +2 -2
  27. package/build/dto/AssetSearchEntity/index.js +12 -29
  28. package/build/dto/Collection/CollectionCreationEntity/index.d.ts +3 -3
  29. package/build/dto/Collection/CollectionCreationEntity/index.js +13 -13
  30. package/build/dto/Collection/CollectionCreationEntity/interface.d.ts +2 -2
  31. package/build/dto/Collection/CollectionEntity/index.d.ts +2 -2
  32. package/build/dto/Collection/CollectionEntity/index.js +1 -1
  33. package/build/dto/CreationEntity/index.d.ts +3 -3
  34. package/build/dto/CreationEntity/index.js +9 -9
  35. package/build/dto/GalleryEntityV2/index.d.ts +4 -4
  36. package/build/dto/GalleryEntityV2/index.js +6 -8
  37. package/build/dto/common/ItemType/data.d.ts +1 -1
  38. package/build/dto/common/ItemType/data.js +25 -25
  39. package/build/entities/creation/collectionCreationBuilder.d.ts +2 -2
  40. package/build/entities/creation/collectionCreationBuilder.js +4 -3
  41. package/build/entities/gallery/builder.js +1 -1
  42. package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.d.ts +6 -7
  43. package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.js +19 -23
  44. package/build/hooks/favorites/useGetUserFevoritesCreations/index.d.ts +8 -9
  45. package/build/hooks/favorites/useGetUserFevoritesCreations/index.js +25 -38
  46. package/build/hooks/galleries/useGetUserGalleriesCreations/index.d.ts +8 -9
  47. package/build/hooks/galleries/useGetUserGalleriesCreations/index.js +25 -38
  48. package/build/hooks/likes/dynamic/useFindCollectionsAndLikes.d.ts +6 -6
  49. package/build/hooks/likes/dynamic/useFindCollectionsAndLikes.js +15 -17
  50. package/build/hooks/likes/dynamic/useFindCreationsAndLikes.d.ts +4 -4
  51. package/build/hooks/likes/dynamic/useFindCreationsAndLikes.js +12 -15
  52. package/build/hooks/likes/dynamic/useGetCollectionInfoAndLikes.d.ts +4 -4
  53. package/build/hooks/likes/dynamic/useGetCollectionInfoAndLikes.js +11 -18
  54. package/build/hooks/likes/dynamic/useGetCreationsAndLikes.d.ts +4 -5
  55. package/build/hooks/likes/dynamic/useGetCreationsAndLikes.js +12 -17
  56. package/build/hooks/likes/dynamic/useGetCreationsAndLikesByType.d.ts +4 -4
  57. package/build/hooks/likes/dynamic/useGetCreationsAndLikesByType.js +16 -19
  58. package/build/hooks/likes/dynamic/useGetMixedLikesFavoriteList.d.ts +5 -6
  59. package/build/hooks/likes/dynamic/useGetMixedLikesFavoriteList.js +9 -10
  60. package/build/hooks/likes/dynamic/useGetTableLikes.d.ts +4 -5
  61. package/build/hooks/likes/dynamic/useGetTableLikes.js +14 -21
  62. package/build/hooks/likes/index.d.ts +1 -1
  63. package/build/hooks/likes/index.js +12 -12
  64. package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.d.ts +5 -5
  65. package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +39 -47
  66. package/build/modules/gallery/store.d.ts +3 -3
  67. package/build/modules/gallery/store.js +7 -11
  68. package/build/modules/gallery/ui/EditGallery.d.ts +2 -2
  69. package/build/modules/gallery/ui/EditGallery.js +11 -11
  70. package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.d.ts +3 -3
  71. package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.js +1 -1
  72. package/build/modules/gallery/ui/chooseGalleryItems/index.d.ts +1 -1
  73. package/build/modules/gallery/ui/chooseGalleryItems/index.js +19 -20
  74. package/build/modules/gallery/ui/itemsPreview/index.d.ts +2 -3
  75. package/build/modules/gallery/ui/itemsPreview/index.js +9 -4
  76. package/build/modules/gallery/useToGalleryAsset.d.ts +5 -5
  77. package/build/modules/gallery/useToGalleryAsset.js +7 -7
  78. package/build/modules/opportunity/OpportunityCard.js +25 -27
  79. package/build/modules/virtuoso/types.d.ts +0 -3
  80. package/build/system/Cards/CardContent/CardCategory/CardCategory.test.d.ts +1 -1
  81. package/build/system/Cards/CardContent/CardCategory/CardCategory.test.js +9 -9
  82. package/build/system/Cards/CardContent/CardCategory/index.d.ts +1 -1
  83. package/build/system/Cards/CardContent/CardCategory/index.js +3 -3
  84. package/build/system/Cards/CreationCard/CardHead.d.ts +2 -3
  85. package/build/system/Cards/CreationCard/CardHead.js +16 -30
  86. package/build/system/Cards/CreationCard/index.d.ts +4 -4
  87. package/build/system/Cards/CreationCard/index.js +10 -9
  88. package/build/system/Cards/MultiMediaCard/index.d.ts +5 -6
  89. package/build/system/Cards/MultiMediaCard/index.js +8 -7
  90. package/build/utils/extractItemIds.d.ts +2 -2
  91. package/build/utils/extractItemIds.js +1 -7
  92. package/package.json +1 -1
@@ -1,6 +1,6 @@
1
- import GalleryEntityV2 from '../../../dto/GalleryEntityV2';
1
+ import { TGallery } from '../../../entities/gallery/types';
2
2
  export declare const EditGallery: ({ galleryId, handleRemoveAsset, gallery, titleAssets, titleForm, inputPlaceHolderText, }: {
3
- gallery: GalleryEntityV2;
3
+ gallery: TGallery;
4
4
  galleryId: string;
5
5
  handleRemoveAsset: (creationIdToRemove: string) => (itemType: "asset" | "collection") => void;
6
6
  titleAssets: string;
@@ -5,13 +5,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.EditGallery = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const styled_components_1 = __importDefault(require("styled-components"));
8
+ const editGalleryForm_1 = __importDefault(require("./editGalleryForm"));
9
+ const useRemoveAssetFromGallery_1 = require("../../../api/server-galleries/mutations/useRemoveAssetFromGallery");
10
+ const useRemoveCollectionFromGallery_1 = require("../../../api/server-galleries/mutations/useRemoveCollectionFromGallery");
9
11
  const useGetAssetsAndCollectionForFavorite_1 = require("../api/useGetAssetsAndCollectionForFavorite");
10
12
  const store_1 = require("../store");
11
13
  const itemsPreview_1 = __importDefault(require("./itemsPreview"));
12
- const useRemoveAssetFromGallery_1 = require("../../../api/server-galleries/mutations/useRemoveAssetFromGallery");
13
- const useRemoveCollectionFromGallery_1 = require("../../../api/server-galleries/mutations/useRemoveCollectionFromGallery");
14
- const editGalleryForm_1 = __importDefault(require("./editGalleryForm"));
14
+ const styled_components_1 = __importDefault(require("styled-components"));
15
15
  const StyledAddFavlist = styled_components_1.default.div `
16
16
  display: flex;
17
17
 
@@ -27,25 +27,25 @@ const EditGallery = ({ galleryId, handleRemoveAsset, gallery, titleAssets, title
27
27
  const { removeAssetFromGallery } = (0, useRemoveAssetFromGallery_1.useRemoveAssetFromGalleryV2)();
28
28
  const { removeCollectionFromGallery } = (0, useRemoveCollectionFromGallery_1.useRemoveCollectionFromGalleryV2)();
29
29
  const handleDeleteCreation = async (itemId) => {
30
- const id = itemId.split('.').splice(1).join('.');
31
- if (itemId.split('.')[0] === 'collection') {
30
+ const id = itemId.split(".").splice(1).join(".");
31
+ if (itemId.split(".")[0] === "collection") {
32
32
  await removeCollectionFromGallery({
33
33
  galleryId,
34
34
  collectionId: id,
35
35
  });
36
- handleRemoveAsset(id)('collection');
37
- removeCreation(id, 'collection');
36
+ handleRemoveAsset(id)("collection");
37
+ removeCreation(id, "collection");
38
38
  }
39
39
  else {
40
40
  await removeAssetFromGallery({
41
41
  galleryId,
42
42
  assetId: id,
43
43
  });
44
- handleRemoveAsset(id)('asset');
45
- removeCreation(id, 'asset');
44
+ handleRemoveAsset(id)("asset");
45
+ removeCreation(id, "asset");
46
46
  }
47
47
  };
48
48
  const allResults = (0, store_1.useGalleryStore)((state) => state.allResults);
49
- return ((0, jsx_runtime_1.jsxs)(StyledAddFavlist, { children: [(0, jsx_runtime_1.jsx)(itemsPreview_1.default, { creations: creationsList, title: titleAssets, deleteMethod: handleDeleteCreation, isLoading: isLoading, loadMore: loadMore, isNextLoading: isNextLoading, allCount: allResults }), (0, jsx_runtime_1.jsx)(editGalleryForm_1.default, { name: gallery.getGalleryName(), description: gallery.getGalleryDescription(), title: titleForm, inputPlaceHolderText: inputPlaceHolderText, galleryId: galleryId })] }));
49
+ return ((0, jsx_runtime_1.jsxs)(StyledAddFavlist, { children: [(0, jsx_runtime_1.jsx)(itemsPreview_1.default, { creations: creationsList, title: titleAssets, deleteMethod: handleDeleteCreation, isLoading: isLoading, loadMore: loadMore, isNextLoading: isNextLoading, allCount: allResults }), (0, jsx_runtime_1.jsx)(editGalleryForm_1.default, { name: gallery.name, description: gallery.description, title: titleForm, inputPlaceHolderText: inputPlaceHolderText, galleryId: galleryId })] }));
50
50
  };
51
51
  exports.EditGallery = EditGallery;
@@ -1,7 +1,7 @@
1
- import GalleryEntityV2 from '../../../../../dto/GalleryEntityV2';
1
+ import { TGallery } from '../../../../../entities/gallery/types';
2
2
  declare const ChooseItem: ({ galleryItem, handleIsSelected, isSelected, }: {
3
- galleryItem: GalleryEntityV2;
4
- handleIsSelected: (arg: GalleryEntityV2) => void;
3
+ galleryItem: TGallery;
4
+ handleIsSelected: (arg: TGallery) => void;
5
5
  isSelected: boolean;
6
6
  }) => import("react/jsx-runtime").JSX.Element;
7
7
  export default ChooseItem;
@@ -92,6 +92,6 @@ const StyledChooseItem = styled_components_1.default.div `
92
92
  }
93
93
  `;
94
94
  // Component
95
- const ChooseItem = ({ galleryItem, handleIsSelected, isSelected, }) => ((0, jsx_runtime_1.jsx)(StyledChooseItem, { isSelected: isSelected, onClick: () => handleIsSelected(galleryItem), children: (0, jsx_runtime_1.jsxs)("div", { className: "content-item-wrapper", children: [(0, jsx_runtime_1.jsx)("div", { className: "content-item-gallery-pic-default", children: (0, jsx_runtime_1.jsx)("div", { className: "image" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "content-item-gallery-name", children: [(0, jsx_runtime_1.jsx)("p", { className: "name", children: galleryItem.getGalleryName() }), (0, jsx_runtime_1.jsx)("span", { className: `items-count`, children: galleryItem.getGalleryItemsCount() })] })] }) }));
95
+ const ChooseItem = ({ galleryItem, handleIsSelected, isSelected, }) => ((0, jsx_runtime_1.jsx)(StyledChooseItem, { isSelected: isSelected, onClick: () => handleIsSelected(galleryItem), children: (0, jsx_runtime_1.jsxs)("div", { className: "content-item-wrapper", children: [(0, jsx_runtime_1.jsx)("div", { className: "content-item-gallery-pic-default", children: (0, jsx_runtime_1.jsx)("div", { className: "image" }) }), (0, jsx_runtime_1.jsxs)("div", { className: "content-item-gallery-name", children: [(0, jsx_runtime_1.jsx)("p", { className: "name", children: galleryItem.name }), (0, jsx_runtime_1.jsx)("span", { className: `items-count`, children: galleryItem.itemsCount })] })] }) }));
96
96
  // Export
97
97
  exports.default = ChooseItem;
@@ -1,4 +1,4 @@
1
- import { ApolloError } from '@apollo/client';
1
+ import { ApolloError } from "@apollo/client";
2
2
  interface IGalleryItems {
3
3
  setAddGallery: (value: boolean) => void;
4
4
  addMethod: (galleryId: string, ids: string[]) => void;
@@ -4,21 +4,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
- const react_1 = require("react");
8
- const react_virtuoso_1 = require("react-virtuoso");
9
- const styled_components_1 = __importDefault(require("styled-components"));
10
- const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
11
- const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
7
+ const useFetchMyFavorites_1 = require("../../../../api/server-galleries/queries/useFetchMyFavorites");
8
+ const useFetchMyGalleries_1 = require("../../../../api/server-galleries/queries/useFetchMyGalleries");
12
9
  const PlaceholderItemsGallery_1 = require("../PlaceholderItemsGallery");
13
10
  const chooseGalleryItem_1 = __importDefault(require("./chooseGalleryItem"));
14
11
  const ui_1 = require("../../../../store/ui");
15
- const useFetchMyFavorites_1 = require("../../../../api/server-galleries/queries/useFetchMyFavorites");
16
- const useFetchMyGalleries_1 = require("../../../../api/server-galleries/queries/useFetchMyGalleries");
17
12
  const ScreenWidth_1 = require("../../../../styles/ScreenWidth");
18
13
  const colors_1 = require("../../../../styles/colors");
19
14
  const typography_1 = require("../../../../styles/typography");
20
15
  const MainButton_1 = __importDefault(require("../../../../system/Buttons/MainButton"));
21
16
  const CardsHolderLoader_1 = __importDefault(require("../../../../system/CardsHolderWithSkeleton/CardsHolderLoader"));
17
+ const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
18
+ const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
19
+ const react_1 = require("react");
20
+ const react_virtuoso_1 = require("react-virtuoso");
21
+ const styled_components_1 = __importDefault(require("styled-components"));
22
22
  // Styles
23
23
  const StyledChooseGalleryItems = styled_components_1.default.div `
24
24
  min-height: calc(460px - 24px);
@@ -111,8 +111,8 @@ const GalleryItems = ({ galleryItems, loadMore, isNextLoading, isAdded, titleBtn
111
111
  setSelectedItem(null);
112
112
  openAlert({
113
113
  type: type_1.alertVariants.success,
114
- caption: 'NFT successfully added!',
115
- text: '',
114
+ caption: "NFT successfully added!",
115
+ text: "",
116
116
  });
117
117
  }
118
118
  }, [isAdded]);
@@ -122,7 +122,7 @@ const GalleryItems = ({ galleryItems, loadMore, isNextLoading, isAdded, titleBtn
122
122
  openAlert({
123
123
  type: type_1.alertVariants.error,
124
124
  caption: error.message,
125
- text: '',
125
+ text: "",
126
126
  });
127
127
  }
128
128
  }, [error]);
@@ -130,14 +130,13 @@ const GalleryItems = ({ galleryItems, loadMore, isNextLoading, isAdded, titleBtn
130
130
  setSelectedItem(newGallery);
131
131
  };
132
132
  const renderItems = galleryItems
133
- ?.filter((gallery) => gallery.getGalleryType() !== 'likelist' &&
134
- gallery.getGalleryId() !== currentMyGalleryId)
135
- .map((galleryItem) => ((0, jsx_runtime_1.jsx)(chooseGalleryItem_1.default, { galleryItem: galleryItem, isSelected: galleryItem.getGalleryId() === selectedItem?.getGalleryId(), handleIsSelected: handleIsSelected }, galleryItem.getGalleryId())));
136
- return ((0, jsx_runtime_1.jsxs)(StyledChooseGalleryItems, { children: [(0, jsx_runtime_1.jsx)("div", { className: 'head', children: (0, jsx_runtime_1.jsx)("h3", { className: 'tittle', children: title }) }), (0, jsx_runtime_1.jsxs)("div", { className: "content", children: [!isLoading && galleryItems && ((0, jsx_runtime_1.jsx)(react_virtuoso_1.Virtuoso, { totalCount: renderItems.length, itemContent: (index) => renderItems[index], endReached: loadMore, overscan: 200, components: {
133
+ ?.filter((gallery) => gallery.galleryType !== "likelist" && gallery.galleryId !== currentMyGalleryId)
134
+ .map((galleryItem) => ((0, jsx_runtime_1.jsx)(chooseGalleryItem_1.default, { galleryItem: galleryItem, isSelected: galleryItem.galleryId === selectedItem?.galleryId, handleIsSelected: handleIsSelected }, galleryItem.galleryId)));
135
+ return ((0, jsx_runtime_1.jsxs)(StyledChooseGalleryItems, { children: [(0, jsx_runtime_1.jsx)("div", { className: "head", children: (0, jsx_runtime_1.jsx)("h3", { className: "tittle", children: title }) }), (0, jsx_runtime_1.jsxs)("div", { className: "content", children: [!isLoading && galleryItems && ((0, jsx_runtime_1.jsx)(react_virtuoso_1.Virtuoso, { totalCount: renderItems.length, itemContent: (index) => renderItems[index], endReached: loadMore, overscan: 200, components: {
137
136
  Footer: () => (isNextLoading ? (0, jsx_runtime_1.jsx)(CardsHolderLoader_1.default, {}) : null),
138
- } })), isLoading && ((0, jsx_runtime_1.jsx)(react_virtuoso_1.Virtuoso, { totalCount: 20, itemContent: () => (0, jsx_runtime_1.jsx)(PlaceholderItemsGallery_1.PlaceholderItemsGallery, {}) }))] }), (0, jsx_runtime_1.jsx)("div", { className: "favoriteBtn", children: (0, jsx_runtime_1.jsx)(MainButton_1.default, { text: titleBtn, variant: "outline", onClick: () => setAddGallery(true) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "btns", children: [(0, jsx_runtime_1.jsx)(MainButton_1.default, { text: 'Add', variant: "primaryM", disabled: !selectedItem || !ids, onClick: () => {
139
- addMethod(selectedItem?.getGalleryId(), ids);
140
- } }), (0, jsx_runtime_1.jsx)(MainButton_1.default, { text: 'Cancel', variant: "secondary", onClick: () => {
137
+ } })), isLoading && (0, jsx_runtime_1.jsx)(react_virtuoso_1.Virtuoso, { totalCount: 20, itemContent: () => (0, jsx_runtime_1.jsx)(PlaceholderItemsGallery_1.PlaceholderItemsGallery, {}) })] }), (0, jsx_runtime_1.jsx)("div", { className: "favoriteBtn", children: (0, jsx_runtime_1.jsx)(MainButton_1.default, { text: titleBtn, variant: "outline", onClick: () => setAddGallery(true) }) }), (0, jsx_runtime_1.jsxs)("div", { className: "btns", children: [(0, jsx_runtime_1.jsx)(MainButton_1.default, { text: "Add", variant: "primaryM", disabled: !selectedItem || !ids, onClick: () => {
138
+ addMethod(selectedItem?.galleryId, ids);
139
+ } }), (0, jsx_runtime_1.jsx)(MainButton_1.default, { text: "Cancel", variant: "secondary", onClick: () => {
141
140
  closeModalSidebarPortal();
142
141
  closeModalSidebar();
143
142
  } })] })] }));
@@ -145,17 +144,17 @@ const GalleryItems = ({ galleryItems, loadMore, isNextLoading, isAdded, titleBtn
145
144
  const GalleryItemsMyGallery = (props) => {
146
145
  const { galleryItems, loadMore, isNextLoading, load, isLoading } = (0, useFetchMyGalleries_1.useFetchMyGalleriesV2)();
147
146
  (0, react_1.useEffect)(() => {
148
- load({ pageSize: 100, pageToken: '' });
147
+ load({ pageSize: 100, pageToken: "" });
149
148
  }, []);
150
149
  return ((0, jsx_runtime_1.jsx)(GalleryItems, { ...props, galleryItems: galleryItems, loadMore: loadMore, isNextLoading: isNextLoading, isLoading: isLoading }));
151
150
  };
152
151
  const GalleryItemsMyFavorite = (props) => {
153
152
  const { galleryItems, loadMore, isNextLoading, load, isLoading } = (0, useFetchMyFavorites_1.useFetchMyFavoritesV2)();
154
153
  (0, react_1.useEffect)(() => {
155
- load({ pageSize: 100, pageToken: '' });
154
+ load({ pageSize: 100, pageToken: "" });
156
155
  }, []);
157
156
  return ((0, jsx_runtime_1.jsx)(GalleryItems, { ...props, galleryItems: galleryItems, loadMore: loadMore, isNextLoading: isNextLoading, isLoading: isLoading }));
158
157
  };
159
- const ChooseGalleryItems = ({ isGetMyGalleries, ...props }) => isGetMyGalleries ? ((0, jsx_runtime_1.jsx)(GalleryItemsMyGallery, { ...props })) : ((0, jsx_runtime_1.jsx)(GalleryItemsMyFavorite, { ...props }));
158
+ const ChooseGalleryItems = ({ isGetMyGalleries, ...props }) => (isGetMyGalleries ? (0, jsx_runtime_1.jsx)(GalleryItemsMyGallery, { ...props }) : (0, jsx_runtime_1.jsx)(GalleryItemsMyFavorite, { ...props }));
160
159
  // Export
161
160
  exports.default = ChooseGalleryItems;
@@ -1,5 +1,4 @@
1
- import CollectionCreationEntity from '../../../../dto/Collection/CollectionCreationEntity';
2
- import CreationEntity from '../../../../dto/CreationEntity';
1
+ import { TCreation } from '../../../../entities/creation/types';
3
2
  import { TVirtuosoData } from '../../../virtuoso/types';
4
3
  export declare const useVirtuosoData: <TData>({ creations, isMobile }: {
5
4
  isMobile: boolean;
@@ -9,7 +8,7 @@ export declare const useVirtuosoData: <TData>({ creations, isMobile }: {
9
8
  placeholderData: number[][];
10
9
  };
11
10
  declare const ItemsPreview: ({ creations, deleteMethod, title, loadMore, isLoading, isNextLoading, allCount, }: {
12
- creations: (CreationEntity | CollectionCreationEntity)[];
11
+ creations: TCreation[];
13
12
  deleteMethod: (itemId: string) => void;
14
13
  title: string;
15
14
  loadMore?: () => void;
@@ -5,7 +5,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.useVirtuosoData = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const CollectionCreationEntity_1 = __importDefault(require("../../../../dto/Collection/CollectionCreationEntity"));
8
+ const CreationMediaView_1 = require("../../../../entities/creation/CreationMediaView");
9
+ const types_1 = require("../../../../entities/labelCreationType/types");
9
10
  const ScreenWidth_1 = require("../../../../styles/ScreenWidth");
10
11
  const colors_1 = require("../../../../styles/colors");
11
12
  const typography_1 = require("../../../../styles/typography");
@@ -239,9 +240,13 @@ const ItemsPreview = ({ creations, deleteMethod, title, loadMore, isLoading, isN
239
240
  }
240
241
  return getGapCards();
241
242
  })(),
242
- }, children: data.map((creation) => ((0, jsx_runtime_1.jsxs)("div", { className: "content-item", children: [creation instanceof CollectionCreationEntity_1.default ? ((0, jsx_runtime_1.jsx)(CardImage_1.default, { alt: `${creation.getName()} ${creation.getAddress() || ""}`, imgSrc: creation.getOriginalUrls()?.[0] ?? "", errorImg: `${constants_1.staticLink}/public/noContent/noContent.svg` })) : (creation.detectMediaType().displaySingleMedia()), (0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/gallery/delete.svg`, alt: "delete", width: 24, height: 24, className: "content-item-gallery-deleteIcon", onClick: () => deleteMethod(creation instanceof CollectionCreationEntity_1.default
243
- ? `${creation.getItemType() + "." + creation.getCreationId()}`
244
- : creation.getCreationId()) })] }, creation.getCreationId()))) }));
243
+ }, children: data.map((creation) => ((0, jsx_runtime_1.jsxs)("div", { className: "content-item", children: [creation.itemType === types_1.LabelKeys.collection ? ((0, jsx_runtime_1.jsx)(CardImage_1.default, { alt: `${creation.name} ${creation.address || ""}`, imgSrc: creation.originalUrls?.[0] ?? "", errorImg: `${constants_1.staticLink}/public/noContent/noContent.svg` })) : ((0, jsx_runtime_1.jsx)(CreationMediaView_1.CreationMediaView, { media: creation.media })), (0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/gallery/delete.svg`, alt: "delete", width: 24, height: 24, className: "content-item-gallery-deleteIcon", onClick: () =>
244
+ // deleteMethod(
245
+ // creation instanceof CollectionCreationEntity
246
+ // ? `${creation.getItemType() + "." + creation.getCreationId()}`
247
+ // : creation.getCreationId(),
248
+ // )
249
+ deleteMethod(creation.creationId) })] }, creation.creationId))) }));
245
250
  },
246
251
  };
247
252
  })();
@@ -1,16 +1,16 @@
1
- import { TCreationAndCollection } from '../virtuoso/types';
1
+ import { TCreation } from '../../entities/creation/types';
2
2
  interface IGalleryAsset {
3
3
  isActiveGalleryMode: boolean;
4
4
  activateGalleryMode: () => void;
5
5
  disableGalleryMode: () => void;
6
- creationsToGallery: TCreationAndCollection[];
7
- toggleCreationToGallery: (creation: TCreationAndCollection) => void;
8
- addCreationToGallery: (creation: TCreationAndCollection) => void;
6
+ creationsToGallery: TCreation[];
7
+ toggleCreationToGallery: (creation: TCreation) => void;
8
+ addCreationToGallery: (creation: TCreation) => void;
9
9
  removeCreationFromGallery: (itemId: string) => void;
10
10
  removeCreationFromGalleryWithCallback: (itemId: string, closeCallback: () => void) => void;
11
11
  resetCreationsInGallery: () => void;
12
12
  }
13
- export declare const getIsActiveCreation: (creations: TCreationAndCollection[], creation: TCreationAndCollection) => boolean;
13
+ export declare const getIsActiveCreation: (creations: TCreation[], creation: TCreation) => boolean;
14
14
  export declare const useToGalleryStore: import("zustand/traditional").UseBoundStoreWithEqualityFn<import("zustand").StoreApi<IGalleryAsset>>;
15
15
  export declare const useInitializeToGalleryAsset: () => {
16
16
  handleAddToGallery: () => void;
@@ -5,12 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.useInitializeToGalleryAsset = exports.useToGalleryStore = exports.getIsActiveCreation = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
+ const addCreationToGallery_1 = __importDefault(require("../../components/gallery/add/addCreationToGallery"));
9
+ const ui_1 = require("../../store/ui");
8
10
  const react_1 = require("react");
9
11
  const shallow_1 = require("zustand/shallow");
10
12
  const traditional_1 = require("zustand/traditional");
11
- const addCreationToGallery_1 = __importDefault(require("../../components/gallery/add/addCreationToGallery"));
12
- const ui_1 = require("../../store/ui");
13
- const getIsActiveCreation = (creations, creation) => !!creations.find((gCreation) => gCreation.getCreationId() === creation.getCreationId());
13
+ const getIsActiveCreation = (creations, creation) => !!creations.find((gCreation) => gCreation.creationId === creation.creationId);
14
14
  exports.getIsActiveCreation = getIsActiveCreation;
15
15
  exports.useToGalleryStore = (0, traditional_1.createWithEqualityFn)()((setState, getState) => ({
16
16
  isActiveGalleryMode: false,
@@ -34,12 +34,12 @@ exports.useToGalleryStore = (0, traditional_1.createWithEqualityFn)()((setState,
34
34
  removeCreationFromGallery: (itemId) => {
35
35
  setState((prev) => ({
36
36
  ...prev,
37
- creationsToGallery: prev.creationsToGallery.filter((pCreation) => pCreation.getCreationId() !== itemId),
37
+ creationsToGallery: prev.creationsToGallery.filter((pCreation) => pCreation.creationId !== itemId),
38
38
  }));
39
39
  },
40
40
  removeCreationFromGalleryWithCallback: (itemId, closeCallback) => {
41
41
  setState((prev) => {
42
- const newCreations = prev.creationsToGallery.filter((pCreation) => pCreation.getCreationId() !== itemId);
42
+ const newCreations = prev.creationsToGallery.filter((pCreation) => pCreation.creationId !== itemId);
43
43
  if (!newCreations.length) {
44
44
  closeCallback();
45
45
  return {
@@ -53,9 +53,9 @@ exports.useToGalleryStore = (0, traditional_1.createWithEqualityFn)()((setState,
53
53
  });
54
54
  },
55
55
  toggleCreationToGallery: (creation) => {
56
- const { removeCreationFromGallery, addCreationToGallery, creationsToGallery, } = getState();
56
+ const { removeCreationFromGallery, addCreationToGallery, creationsToGallery } = getState();
57
57
  if ((0, exports.getIsActiveCreation)(creationsToGallery, creation)) {
58
- removeCreationFromGallery(creation.getCreationId());
58
+ removeCreationFromGallery(creation.creationId);
59
59
  }
60
60
  else {
61
61
  addCreationToGallery(creation);
@@ -5,37 +5,37 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.OpportunityCard = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const react_1 = require("react");
9
- const moment_1 = __importDefault(require("moment/moment"));
10
- const styled_components_1 = __importDefault(require("styled-components"));
11
- const colors_1 = require("@ludo.ninja/ui/build/styles/colors");
12
- const boxShadow_1 = __importDefault(require("@ludo.ninja/ui/build/styles/mixins/boxShadow"));
13
- const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
14
- const data_1 = __importDefault(require("../../dto/common/ItemType/data"));
8
+ const useDislikeOpportunity_1 = require("../../api/server-opportunities/mutations/useDislikeOpportunity");
9
+ const useLikeOpportunity_1 = require("../../api/server-opportunities/mutations/useLikeOpportunity");
10
+ const useOpenOpportunity_1 = __importDefault(require("../../api/server-opportunities/mutations/useOpenOpportunity"));
11
+ const data_1 = __importDefault(require("../../entities/labelCreationType/data"));
12
+ const vars_1 = require("../../fonts/vars");
13
+ const OpportunityDropDown_1 = require("./OpportunityDropDown");
14
+ const ShareIcon_1 = require("./ShareIcon");
15
+ const OpportunityMenu_1 = require("./popup/OpportunityMenu");
15
16
  const store_1 = require("../user/store");
17
+ const heart_svg_1 = __importDefault(require("../../public/cards/heart"));
16
18
  const env_1 = require("../../store/env");
17
19
  const ui_1 = require("../../store/ui");
18
20
  const ScreenWidth_1 = require("../../styles/ScreenWidth");
19
- const colors_2 = require("../../styles/colors");
21
+ const colors_1 = require("../../styles/colors");
20
22
  const boxTransform_1 = __importDefault(require("../../styles/mixins/boxTransform"));
21
23
  const typography_1 = require("../../styles/typography");
22
- const index_1 = require("../../system/index");
23
24
  const CardCategory_1 = __importDefault(require("../../system/Cards/CardContent/CardCategory"));
24
25
  const Headicons_1 = __importDefault(require("../../system/Cards/Styles/Headicons"));
25
26
  const ImageInterceptor_1 = require("../../system/Img/ImageInterceptor");
27
+ const index_1 = require("../../system/index");
26
28
  const screen_1 = require("../../utils/screen");
27
- const OpportunityDropDown_1 = require("./OpportunityDropDown");
28
- const ShareIcon_1 = require("./ShareIcon");
29
- const OpportunityMenu_1 = require("./popup/OpportunityMenu");
30
- const useDislikeOpportunity_1 = require("../../api/server-opportunities/mutations/useDislikeOpportunity");
31
- const useLikeOpportunity_1 = require("../../api/server-opportunities/mutations/useLikeOpportunity");
32
- const vars_1 = require("../../fonts/vars");
33
- const heart_svg_1 = __importDefault(require("../../public/cards/heart"));
34
29
  const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
35
- const useOpenOpportunity_1 = __importDefault(require("../../api/server-opportunities/mutations/useOpenOpportunity"));
30
+ const colors_2 = require("@ludo.ninja/ui/build/styles/colors");
31
+ const boxShadow_1 = __importDefault(require("@ludo.ninja/ui/build/styles/mixins/boxShadow"));
32
+ const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
33
+ const moment_1 = __importDefault(require("moment/moment"));
34
+ const react_1 = require("react");
35
+ const styled_components_1 = __importDefault(require("styled-components"));
36
36
  const SWrapperLink = styled_components_1.default.a `
37
37
  position: relative;
38
- background-color: ${colors_1.WhiteColor};
38
+ background-color: ${colors_2.WhiteColor};
39
39
  border-radius: 6px;
40
40
  ${boxShadow_1.default};
41
41
  ${boxTransform_1.default};
@@ -114,7 +114,7 @@ const StyledCardContent = styled_components_1.default.div `
114
114
  .mainName {
115
115
  font-family: ${vars_1.dmsansFontVarCss.css};
116
116
  ${typography_1.TextSmall};
117
- color: ${colors_2.TextGrayColor};
117
+ color: ${colors_1.TextGrayColor};
118
118
  font-size: 13px;
119
119
  flex: 1;
120
120
  -webkit-line-clamp: 6;
@@ -126,7 +126,7 @@ const StyledCardContent = styled_components_1.default.div `
126
126
  .secondName {
127
127
  font-family: ${vars_1.poppinsFontVarCss.css};
128
128
  ${typography_1.FH5};
129
- color: ${colors_2.BlackColor};
129
+ color: ${colors_1.BlackColor};
130
130
  font-size: 15px;
131
131
  overflow: hidden;
132
132
  text-overflow: ellipsis;
@@ -144,7 +144,6 @@ const StyledCardContent = styled_components_1.default.div `
144
144
  }
145
145
  }
146
146
 
147
-
148
147
  .date {
149
148
  color: #b0b2c0;
150
149
  font-size: 12px;
@@ -233,8 +232,7 @@ const OpportunityCard = ({ opportunity, toolsForRemove, }) => {
233
232
  }));
234
233
  const { windowDimensions } = (0, screen_1.useWindowDimensionsWithServerInitial)();
235
234
  const { openOpportunityAction } = (0, useOpenOpportunity_1.default)();
236
- const isMobile = !!(windowDimensions?.windowWidth &&
237
- windowDimensions.windowWidth <= ScreenWidth_1.ScreenWidth.DESKTOP);
235
+ const isMobile = !!(windowDimensions?.windowWidth && windowDimensions.windowWidth <= ScreenWidth_1.ScreenWidth.DESKTOP);
238
236
  const isSignedIn = (0, store_1.useUserStore)((state) => state.isSignedIn);
239
237
  const { openModalSidebarPortal, closeModalSidebarPortal } = (0, ui_1.useUiStore)((state) => ({
240
238
  openModalSidebarPortal: state.openModalSidebarPortal,
@@ -242,10 +240,10 @@ const OpportunityCard = ({ opportunity, toolsForRemove, }) => {
242
240
  }));
243
241
  const getMediaENVDomain = (0, env_1.useEnvStore)((state) => state.getMediaDomain);
244
242
  const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
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
247
- ? `${getMediaENVDomain()}/opportunity-medias/${opportunity.media}`
248
- : "" }), (0, jsx_runtime_1.jsx)(Headicons_1.default, { isMobile: isMobile, onClick: (e) => {
243
+ const opportunityLink = opportunity.opportunityType === "TOKEN_AIRDROP"
244
+ ? `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/brand/${opportunity.opportunityId}`
245
+ : 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 ? `${getMediaENVDomain()}/opportunity-medias/${opportunity.media}` : "" }), (0, jsx_runtime_1.jsx)(Headicons_1.default, { isMobile: isMobile, onClick: (e) => {
249
247
  e.stopPropagation();
250
248
  e.preventDefault();
251
249
  }, children: (0, jsx_runtime_1.jsxs)("div", { className: "icons", children: [(0, jsx_runtime_1.jsx)("div", { className: "icon", onClick: () => {
@@ -1,6 +1,3 @@
1
- import CollectionCreationEntity from '../../dto/Collection/CollectionCreationEntity';
2
- import CreationEntity from '../../dto/CreationEntity';
3
- export type TCreationAndCollection = CreationEntity | CollectionCreationEntity;
4
1
  export type TVirtuosoData<TData> = {
5
2
  creationPacks: TData[][];
6
3
  creations: TData[];
@@ -1 +1 @@
1
- import '@testing-library/jest-dom/extend-expect';
1
+ import "@testing-library/jest-dom/extend-expect";
@@ -4,24 +4,24 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
+ const index_1 = __importDefault(require("./index"));
8
+ const types_1 = require("../../../../entities/labelCreationType/types");
7
9
  require("@testing-library/jest-dom/extend-expect");
8
10
  const react_1 = require("@testing-library/react");
9
- const ItemType_1 = require("../../../../dto/common/ItemType");
10
- const index_1 = __importDefault(require("./index"));
11
- describe('CardCategory Component', () => {
11
+ describe("CardCategory Component", () => {
12
12
  const labelMock = {
13
- text: ItemType_1.LabelText.opportunity,
14
- backgroundColor: ItemType_1.LabelBackground.opportunity,
15
- color: ItemType_1.LabelColor.opportunity,
13
+ text: types_1.LabelText.opportunity,
14
+ backgroundColor: types_1.LabelBackground.opportunity,
15
+ color: types_1.LabelColor.opportunity,
16
16
  };
17
- test('renders the component with the provided label', () => {
17
+ test("renders the component with the provided label", () => {
18
18
  (0, react_1.render)((0, jsx_runtime_1.jsx)(index_1.default, { label: labelMock }));
19
- const labelElement = react_1.screen.getByText(ItemType_1.LabelText.opportunity);
19
+ const labelElement = react_1.screen.getByText(types_1.LabelText.opportunity);
20
20
  expect(labelElement).toBeInTheDocument();
21
21
  expect(labelElement).toHaveStyle(`background: ${labelMock.backgroundColor}`);
22
22
  expect(labelElement).toHaveStyle(`color: ${labelMock.color}`);
23
23
  });
24
- test('does not render the component when no label is provided', () => {
24
+ test("does not render the component when no label is provided", () => {
25
25
  const { container } = (0, react_1.render)((0, jsx_runtime_1.jsx)(index_1.default, { label: undefined }));
26
26
  expect(container.firstChild).toBeNull();
27
27
  });
@@ -1,4 +1,4 @@
1
- import { LabelType } from '../../../../dto/common/ItemType';
1
+ import { LabelType } from '../../../../entities/labelCreationType/types';
2
2
  declare const CardCategory: ({ label }: {
3
3
  label: LabelType | undefined;
4
4
  }) => import("react/jsx-runtime").JSX.Element | null;
@@ -4,10 +4,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  const jsx_runtime_1 = require("react/jsx-runtime");
7
- const styled_components_1 = __importDefault(require("styled-components"));
8
- const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
9
7
  const ScreenWidth_1 = require("../../../../styles/ScreenWidth");
10
8
  const typography_1 = require("../../../../styles/typography");
9
+ const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
10
+ const styled_components_1 = __importDefault(require("styled-components"));
11
11
  // Styles
12
12
  const StyledCardCategory = styled_components_1.default.div `
13
13
  display: flex;
@@ -48,7 +48,7 @@ const StyledCardCategory = styled_components_1.default.div `
48
48
  const CardCategory = ({ label }) => {
49
49
  if (!label)
50
50
  return null;
51
- return ((0, jsx_runtime_1.jsx)(StyledCardCategory, { background: label.backgroundColor, color: label.color, children: (0, jsx_runtime_1.jsx)("div", { className: 'category', children: (0, jsx_runtime_1.jsx)("span", { className: 'label', children: label.text }) }) }));
51
+ return ((0, jsx_runtime_1.jsx)(StyledCardCategory, { background: label.backgroundColor, color: label.color, children: (0, jsx_runtime_1.jsx)("div", { className: "category", children: (0, jsx_runtime_1.jsx)("span", { className: "label", children: label.text }) }) }));
52
52
  };
53
53
  // Export
54
54
  exports.default = CardCategory;
@@ -1,7 +1,6 @@
1
- import CollectionCreationEntity from '../../../dto/Collection/CollectionCreationEntity';
2
- import CreationEntity from '../../../dto/CreationEntity';
1
+ import { TCreation } from '../../../entities/creation/types';
3
2
  export declare const CardHead: ({ creation, isRegularCard, isIconLiked, addLikeToCard, deleteLikeFromCard, isUserProfile, isDisabled, isShowCheckbox, currentMyGalleryId, }: {
4
- creation: CreationEntity | CollectionCreationEntity;
3
+ creation: TCreation;
5
4
  isRegularCard: boolean;
6
5
  isIconLiked: boolean;
7
6
  addLikeToCard: (id: string) => void;
@@ -5,11 +5,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.CardHead = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const router_1 = require("next/router");
9
8
  const addCreationToFavoriteList_1 = __importDefault(require("../../../components/favoriteList/add/addCreationToFavoriteList"));
10
- const CollectionCreationEntity_1 = __importDefault(require("../../../dto/Collection/CollectionCreationEntity"));
11
- const ItemType_1 = require("../../../dto/common/ItemType");
9
+ const types_1 = require("../../../entities/labelCreationType/types");
12
10
  const store_1 = require("../../../modules/user/store");
11
+ const addToFavListIcon_svg_1 = __importDefault(require("../../../public/cards/addToFavListIcon"));
12
+ const addToGalleryIcon_svg_1 = __importDefault(require("../../../public/cards/addToGalleryIcon"));
13
+ const heart_svg_1 = __importDefault(require("../../../public/cards/heart"));
13
14
  const env_1 = require("../../../store/env");
14
15
  const ui_1 = require("../../../store/ui");
15
16
  const ScreenWidth_1 = require("../../../styles/ScreenWidth");
@@ -17,9 +18,7 @@ const CardRank_1 = __importDefault(require("../CardRank"));
17
18
  const Headicons_1 = __importDefault(require("../Styles/Headicons"));
18
19
  const auth_1 = require("../../../utils/auth");
19
20
  const screen_1 = require("../../../utils/screen");
20
- const addToFavListIcon_svg_1 = __importDefault(require("../../../public/cards/addToFavListIcon"));
21
- const addToGalleryIcon_svg_1 = __importDefault(require("../../../public/cards/addToGalleryIcon"));
22
- const heart_svg_1 = __importDefault(require("../../../public/cards/heart"));
21
+ const router_1 = require("next/router");
23
22
  // Component
24
23
  const CardHead = ({ creation, isRegularCard, isIconLiked, addLikeToCard, deleteLikeFromCard, isUserProfile, isDisabled, isShowCheckbox, currentMyGalleryId, }) => {
25
24
  const redirectToLoginWindow = (0, auth_1.useRedirectToLoginWindow)();
@@ -28,49 +27,36 @@ const CardHead = ({ creation, isRegularCard, isIconLiked, addLikeToCard, deleteL
28
27
  const isSignedIn = (0, store_1.useUserStore)((state) => state.isSignedIn);
29
28
  const isLicked = isIconLiked && isSignedIn;
30
29
  const { windowDimensions } = (0, screen_1.useWindowDimensionsWithServerInitial)();
31
- const isMobile = !!(windowDimensions?.windowWidth &&
32
- windowDimensions.windowWidth <= ScreenWidth_1.ScreenWidth.DESKTOP);
30
+ const isMobile = !!(windowDimensions?.windowWidth && windowDimensions.windowWidth <= ScreenWidth_1.ScreenWidth.DESKTOP);
33
31
  const router = (0, router_1.useRouter)();
34
- const isGallery = router.pathname.includes('gallery');
32
+ const isGallery = router.pathname.includes("gallery");
35
33
  const handleClick = async (e, type) => {
36
34
  e.preventDefault();
37
35
  e.stopPropagation();
38
36
  if (!isSignedIn) {
39
37
  redirectToLoginWindow();
40
38
  }
41
- else if (type === 'fav-list') {
42
- openModalSidebarPortal((0, jsx_runtime_1.jsx)(addCreationToFavoriteList_1.default, { ids: [
43
- creation instanceof CollectionCreationEntity_1.default
44
- ? `${creation.getItemType() + '.' + creation.getCreationId()}`
45
- : creation.getCreationId(),
46
- ], currentMyGalleryId: currentMyGalleryId }));
39
+ else if (type === "fav-list") {
40
+ openModalSidebarPortal((0, jsx_runtime_1.jsx)(addCreationToFavoriteList_1.default, { ids: [creation.creationId], currentMyGalleryId: currentMyGalleryId }));
47
41
  }
48
- else if (type === 'likes') {
42
+ else if (type === "likes") {
49
43
  if (!isLicked) {
50
- await addLikeToCard(creation instanceof CollectionCreationEntity_1.default &&
51
- creation.getItemType() !== ItemType_1.LabelKeys.collection
52
- ? creation.getCollectionCreationId()
53
- : creation.getItemId());
44
+ await addLikeToCard(creation.itemId);
54
45
  }
55
46
  else {
56
- await deleteLikeFromCard(creation instanceof CollectionCreationEntity_1.default &&
57
- creation.getItemType() !== ItemType_1.LabelKeys.collection
58
- ? creation.getCollectionCreationId()
59
- : creation.getItemId());
47
+ await deleteLikeFromCard(creation.itemId);
60
48
  }
61
49
  }
62
50
  };
63
51
  const renderLikeButton = () => {
64
- if ([ItemType_1.LabelKeys.asset, ItemType_1.LabelKeys.collection].includes(creation.getItemType())) {
65
- return ((0, jsx_runtime_1.jsx)("div", { className: `icon like ${isLicked ? 'liked' : ''}`, onClick: (e) => handleClick(e, 'likes'), children: (0, jsx_runtime_1.jsx)(heart_svg_1.default, {}) }));
52
+ if ([types_1.LabelKeys.asset, types_1.LabelKeys.collection].includes(creation.itemType)) {
53
+ return ((0, jsx_runtime_1.jsx)("div", { className: `icon like ${isLicked ? "liked" : ""}`, onClick: (e) => handleClick(e, "likes"), children: (0, jsx_runtime_1.jsx)(heart_svg_1.default, {}) }));
66
54
  }
67
55
  };
68
56
  return ((0, jsx_runtime_1.jsxs)(Headicons_1.default, { isMobile: isMobile, style: isDisabled
69
57
  ? {
70
- pointerEvents: 'none',
58
+ pointerEvents: "none",
71
59
  }
72
- : {}, children: [(0, jsx_runtime_1.jsx)("div", { className: 'rank', children: (0, jsx_runtime_1.jsx)(CardRank_1.default, { rank: creation.getRank() }) }), !isProd() && !isShowCheckbox && ((0, jsx_runtime_1.jsxs)("div", { className: "icons", children: [(0, jsx_runtime_1.jsx)("div", { className: "icon", onClick: (e) => handleClick(e, isRegularCard || !isUserProfile || isGallery
73
- ? 'fav-list'
74
- : 'gallery'), children: isRegularCard || !isUserProfile || isGallery ? ((0, jsx_runtime_1.jsx)(addToFavListIcon_svg_1.default, {})) : ((0, jsx_runtime_1.jsx)(addToGalleryIcon_svg_1.default, {})) }), renderLikeButton()] }))] }));
60
+ : {}, children: [(0, jsx_runtime_1.jsx)("div", { className: "rank", children: (0, jsx_runtime_1.jsx)(CardRank_1.default, { rank: creation.rank }) }), !isProd() && !isShowCheckbox && ((0, jsx_runtime_1.jsxs)("div", { className: "icons", children: [(0, jsx_runtime_1.jsx)("div", { className: "icon", onClick: (e) => handleClick(e, isRegularCard || !isUserProfile || isGallery ? "fav-list" : "gallery"), children: isRegularCard || !isUserProfile || isGallery ? (0, jsx_runtime_1.jsx)(addToFavListIcon_svg_1.default, {}) : (0, jsx_runtime_1.jsx)(addToGalleryIcon_svg_1.default, {}) }), renderLikeButton()] }))] }));
75
61
  };
76
62
  exports.CardHead = CardHead;