@ludo.ninja/components 2.2.36 → 2.2.37
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/build/api/server-galleries/queries/useFetchGallery/index.d.ts +5 -5
- package/build/api/server-galleries/queries/useFetchGallery/index.js +5 -8
- package/build/api/server-galleries/queries/useFetchMyFavorites/index.d.ts +3 -3
- package/build/api/server-galleries/queries/useFetchMyFavorites/index.js +5 -11
- package/build/api/server-galleries/queries/useFetchMyGalleries/index.d.ts +3 -3
- package/build/api/server-galleries/queries/useFetchMyGalleries/index.js +5 -11
- package/build/api/server-galleries/queries/useFetchUserFavorites/index.d.ts +4 -4
- package/build/api/server-galleries/queries/useFetchUserFavorites/index.js +6 -9
- package/build/components/assetPage/assetLikes/index.js +7 -7
- package/build/components/search/searchSuggestions/index.js +2 -2
- package/build/dto/AssetEntity/index.d.ts +3 -3
- package/build/dto/AssetEntity/index.js +16 -33
- package/build/dto/AssetSearchEntity/index.d.ts +2 -2
- package/build/dto/AssetSearchEntity/index.js +12 -29
- package/build/dto/Collection/CollectionCreationEntity/index.d.ts +3 -3
- package/build/dto/Collection/CollectionCreationEntity/index.js +13 -13
- package/build/dto/Collection/CollectionCreationEntity/interface.d.ts +2 -2
- package/build/dto/Collection/CollectionEntity/index.d.ts +2 -2
- package/build/dto/Collection/CollectionEntity/index.js +1 -1
- package/build/dto/CreationEntity/index.d.ts +3 -3
- package/build/dto/CreationEntity/index.js +9 -9
- package/build/dto/GalleryEntityV2/index.d.ts +4 -4
- package/build/dto/GalleryEntityV2/index.js +6 -8
- package/build/dto/common/ItemType/data.d.ts +1 -1
- package/build/dto/common/ItemType/data.js +25 -25
- package/build/entities/gallery/builder.js +1 -1
- package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.d.ts +4 -4
- package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.js +17 -19
- package/build/hooks/favorites/useGetUserFevoritesCreations/index.d.ts +5 -5
- package/build/hooks/favorites/useGetUserFevoritesCreations/index.js +23 -33
- package/build/hooks/galleries/useGetUserGalleriesCreations/index.d.ts +5 -5
- package/build/hooks/galleries/useGetUserGalleriesCreations/index.js +23 -33
- package/build/hooks/likes/dynamic/useGetMixedLikesFavoriteList.d.ts +1 -1
- package/build/hooks/likes/index.d.ts +1 -1
- package/build/hooks/likes/index.js +12 -12
- package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.d.ts +4 -4
- package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +35 -40
- package/build/modules/gallery/store.d.ts +3 -3
- package/build/modules/gallery/store.js +7 -11
- package/build/modules/gallery/ui/EditGallery.d.ts +2 -2
- package/build/modules/gallery/ui/EditGallery.js +11 -11
- package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.d.ts +3 -3
- package/build/modules/gallery/ui/chooseGalleryItems/chooseGalleryItem/index.js +1 -1
- package/build/modules/gallery/ui/chooseGalleryItems/index.d.ts +1 -1
- package/build/modules/gallery/ui/chooseGalleryItems/index.js +19 -20
- package/build/modules/opportunity/OpportunityCard.js +25 -27
- package/build/system/Cards/CardContent/CardCategory/CardCategory.test.d.ts +1 -1
- package/build/system/Cards/CardContent/CardCategory/CardCategory.test.js +9 -9
- package/build/system/Cards/CardContent/CardCategory/index.d.ts +1 -1
- package/build/system/Cards/CardContent/CardCategory/index.js +3 -3
- package/build/system/Cards/CreationCard/CardHead.js +16 -21
- package/build/system/Cards/CreationCard/index.d.ts +2 -2
- package/build/system/Cards/CreationCard/index.js +5 -5
- package/build/system/Cards/MultiMediaCard/index.d.ts +2 -2
- package/build/system/Cards/MultiMediaCard/index.js +3 -3
- package/package.json +1 -1
|
@@ -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
|
|
8
|
-
const
|
|
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:
|
|
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.
|
|
134
|
-
|
|
135
|
-
|
|
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 && (
|
|
139
|
-
addMethod(selectedItem?.
|
|
140
|
-
} }), (0, jsx_runtime_1.jsx)(MainButton_1.default, { text:
|
|
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 ? (
|
|
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;
|
|
@@ -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
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const
|
|
14
|
-
const
|
|
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
|
|
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
|
|
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: ${
|
|
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: ${
|
|
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: ${
|
|
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 ===
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
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 +1 @@
|
|
|
1
|
-
import
|
|
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
|
-
|
|
10
|
-
const index_1 = __importDefault(require("./index"));
|
|
11
|
-
describe('CardCategory Component', () => {
|
|
11
|
+
describe("CardCategory Component", () => {
|
|
12
12
|
const labelMock = {
|
|
13
|
-
text:
|
|
14
|
-
backgroundColor:
|
|
15
|
-
color:
|
|
13
|
+
text: types_1.LabelText.opportunity,
|
|
14
|
+
backgroundColor: types_1.LabelBackground.opportunity,
|
|
15
|
+
color: types_1.LabelColor.opportunity,
|
|
16
16
|
};
|
|
17
|
-
test(
|
|
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(
|
|
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(
|
|
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
|
});
|
|
@@ -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:
|
|
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;
|
|
@@ -5,11 +5,13 @@ 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
9
|
const CollectionCreationEntity_1 = __importDefault(require("../../../dto/Collection/CollectionCreationEntity"));
|
|
11
|
-
const
|
|
10
|
+
const types_1 = require("../../../entities/labelCreationType/types");
|
|
12
11
|
const store_1 = require("../../../modules/user/store");
|
|
12
|
+
const addToFavListIcon_svg_1 = __importDefault(require("../../../public/cards/addToFavListIcon"));
|
|
13
|
+
const addToGalleryIcon_svg_1 = __importDefault(require("../../../public/cards/addToGalleryIcon"));
|
|
14
|
+
const heart_svg_1 = __importDefault(require("../../../public/cards/heart"));
|
|
13
15
|
const env_1 = require("../../../store/env");
|
|
14
16
|
const ui_1 = require("../../../store/ui");
|
|
15
17
|
const ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
@@ -17,9 +19,7 @@ const CardRank_1 = __importDefault(require("../CardRank"));
|
|
|
17
19
|
const Headicons_1 = __importDefault(require("../Styles/Headicons"));
|
|
18
20
|
const auth_1 = require("../../../utils/auth");
|
|
19
21
|
const screen_1 = require("../../../utils/screen");
|
|
20
|
-
const
|
|
21
|
-
const addToGalleryIcon_svg_1 = __importDefault(require("../../../public/cards/addToGalleryIcon"));
|
|
22
|
-
const heart_svg_1 = __importDefault(require("../../../public/cards/heart"));
|
|
22
|
+
const router_1 = require("next/router");
|
|
23
23
|
// Component
|
|
24
24
|
const CardHead = ({ creation, isRegularCard, isIconLiked, addLikeToCard, deleteLikeFromCard, isUserProfile, isDisabled, isShowCheckbox, currentMyGalleryId, }) => {
|
|
25
25
|
const redirectToLoginWindow = (0, auth_1.useRedirectToLoginWindow)();
|
|
@@ -28,49 +28,44 @@ const CardHead = ({ creation, isRegularCard, isIconLiked, addLikeToCard, deleteL
|
|
|
28
28
|
const isSignedIn = (0, store_1.useUserStore)((state) => state.isSignedIn);
|
|
29
29
|
const isLicked = isIconLiked && isSignedIn;
|
|
30
30
|
const { windowDimensions } = (0, screen_1.useWindowDimensionsWithServerInitial)();
|
|
31
|
-
const isMobile = !!(windowDimensions?.windowWidth &&
|
|
32
|
-
windowDimensions.windowWidth <= ScreenWidth_1.ScreenWidth.DESKTOP);
|
|
31
|
+
const isMobile = !!(windowDimensions?.windowWidth && windowDimensions.windowWidth <= ScreenWidth_1.ScreenWidth.DESKTOP);
|
|
33
32
|
const router = (0, router_1.useRouter)();
|
|
34
|
-
const isGallery = router.pathname.includes(
|
|
33
|
+
const isGallery = router.pathname.includes("gallery");
|
|
35
34
|
const handleClick = async (e, type) => {
|
|
36
35
|
e.preventDefault();
|
|
37
36
|
e.stopPropagation();
|
|
38
37
|
if (!isSignedIn) {
|
|
39
38
|
redirectToLoginWindow();
|
|
40
39
|
}
|
|
41
|
-
else if (type ===
|
|
40
|
+
else if (type === "fav-list") {
|
|
42
41
|
openModalSidebarPortal((0, jsx_runtime_1.jsx)(addCreationToFavoriteList_1.default, { ids: [
|
|
43
42
|
creation instanceof CollectionCreationEntity_1.default
|
|
44
|
-
? `${creation.getItemType() +
|
|
43
|
+
? `${creation.getItemType() + "." + creation.getCreationId()}`
|
|
45
44
|
: creation.getCreationId(),
|
|
46
45
|
], currentMyGalleryId: currentMyGalleryId }));
|
|
47
46
|
}
|
|
48
|
-
else if (type ===
|
|
47
|
+
else if (type === "likes") {
|
|
49
48
|
if (!isLicked) {
|
|
50
|
-
await addLikeToCard(creation instanceof CollectionCreationEntity_1.default &&
|
|
51
|
-
creation.getItemType() !== ItemType_1.LabelKeys.collection
|
|
49
|
+
await addLikeToCard(creation instanceof CollectionCreationEntity_1.default && creation.getItemType() !== types_1.LabelKeys.collection
|
|
52
50
|
? creation.getCollectionCreationId()
|
|
53
51
|
: creation.getItemId());
|
|
54
52
|
}
|
|
55
53
|
else {
|
|
56
|
-
await deleteLikeFromCard(creation instanceof CollectionCreationEntity_1.default &&
|
|
57
|
-
creation.getItemType() !== ItemType_1.LabelKeys.collection
|
|
54
|
+
await deleteLikeFromCard(creation instanceof CollectionCreationEntity_1.default && creation.getItemType() !== types_1.LabelKeys.collection
|
|
58
55
|
? creation.getCollectionCreationId()
|
|
59
56
|
: creation.getItemId());
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
};
|
|
63
60
|
const renderLikeButton = () => {
|
|
64
|
-
if ([
|
|
65
|
-
return ((0, jsx_runtime_1.jsx)("div", { className: `icon like ${isLicked ?
|
|
61
|
+
if ([types_1.LabelKeys.asset, types_1.LabelKeys.collection].includes(creation.getItemType())) {
|
|
62
|
+
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
63
|
}
|
|
67
64
|
};
|
|
68
65
|
return ((0, jsx_runtime_1.jsxs)(Headicons_1.default, { isMobile: isMobile, style: isDisabled
|
|
69
66
|
? {
|
|
70
|
-
pointerEvents:
|
|
67
|
+
pointerEvents: "none",
|
|
71
68
|
}
|
|
72
|
-
: {}, children: [(0, jsx_runtime_1.jsx)("div", { className:
|
|
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()] }))] }));
|
|
69
|
+
: {}, 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 ? "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
70
|
};
|
|
76
71
|
exports.CardHead = CardHead;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { TGallery } from '../../../entities/gallery/types';
|
|
2
2
|
import { TCreationAndCollection } from '../../../modules/virtuoso/types';
|
|
3
3
|
import { searchSchema as schema } from "@ludo.ninja/api";
|
|
4
4
|
import { ReactNode } from "react";
|
|
5
5
|
export type RemoveToolsType = {
|
|
6
|
-
gallery?:
|
|
6
|
+
gallery?: TGallery;
|
|
7
7
|
removeFn: (itemType: "asset" | "collection") => void;
|
|
8
8
|
};
|
|
9
9
|
export interface ICheckboxState {
|
|
@@ -28,7 +28,7 @@ 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
|
|
31
|
+
const types_1 = require("../../../entities/labelCreationType/types");
|
|
32
32
|
const likes_1 = __importDefault(require("../../../hooks/likes"));
|
|
33
33
|
const env_1 = require("../../../store/env");
|
|
34
34
|
const ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
@@ -109,11 +109,11 @@ const CreationCard = ({ creationName, creation, isNeedHeight, likesDynamicInfo,
|
|
|
109
109
|
const isHideProd = isProd();
|
|
110
110
|
const HideLink = isHideProd ? react_1.default.Fragment : link_1.default;
|
|
111
111
|
const getLink = (href) => {
|
|
112
|
-
if (creation.getItemType() ===
|
|
113
|
-
return `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["asset"]}/${href.replace(`/${
|
|
112
|
+
if (creation.getItemType() === types_1.LabelKeys.asset) {
|
|
113
|
+
return `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["asset"]}/${href.replace(`/${types_1.LabelKeys.asset}/`, "")}`;
|
|
114
114
|
}
|
|
115
|
-
if (creation.getItemType() ===
|
|
116
|
-
return `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["collections"]}/${href.replace(`/${
|
|
115
|
+
if (creation.getItemType() === types_1.LabelKeys.collection) {
|
|
116
|
+
return `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["collections"]}/${href.replace(`/${types_1.LabelKeys.collection}/`, "")}`;
|
|
117
117
|
}
|
|
118
118
|
return href;
|
|
119
119
|
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import CollectionCreationEntity from '../../../dto/Collection/CollectionCreationEntity';
|
|
2
2
|
import CreationEntity from '../../../dto/CreationEntity';
|
|
3
|
-
import
|
|
3
|
+
import { TGallery } from '../../../entities/gallery/types';
|
|
4
4
|
declare const MultiMediaCard: ({ gallery, assets, collections, }: {
|
|
5
|
-
gallery:
|
|
5
|
+
gallery: TGallery;
|
|
6
6
|
assets: CreationEntity[] | null;
|
|
7
7
|
collections: CollectionCreationEntity[] | null;
|
|
8
8
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -96,7 +96,7 @@ const MultiMediaCard = ({ gallery, assets, collections, }) => {
|
|
|
96
96
|
// (!collections || collections.length === 0)
|
|
97
97
|
// )
|
|
98
98
|
// return null;
|
|
99
|
-
const galleryCreationIds = gallery.
|
|
99
|
+
const galleryCreationIds = gallery.creationIds;
|
|
100
100
|
const cardsMedia = [];
|
|
101
101
|
for (let i = 0; i < 4; i++) {
|
|
102
102
|
const creationId = galleryCreationIds[i];
|
|
@@ -116,10 +116,10 @@ const MultiMediaCard = ({ gallery, assets, collections, }) => {
|
|
|
116
116
|
}
|
|
117
117
|
return cardsMedia;
|
|
118
118
|
};
|
|
119
|
-
const secondName = gallery.
|
|
119
|
+
const secondName = gallery.username !== "" ? gallery.username : "";
|
|
120
120
|
// const userCreationAddresses = gallery?.getGalleryCreations()[0]?.getOwnersAddresses();
|
|
121
121
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
122
|
-
return ((0, jsx_runtime_1.jsx)(StyledMultiCard, { children: (0, jsx_runtime_1.jsxs)(link_1.default, { href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}${gallery.
|
|
122
|
+
return ((0, jsx_runtime_1.jsx)(StyledMultiCard, { children: (0, jsx_runtime_1.jsxs)(link_1.default, { href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}${gallery.creationLink}`, children: [(0, jsx_runtime_1.jsx)(MultiHead_1.default, { children: renderMedia() }), (0, jsx_runtime_1.jsx)(CardContent_1.default, { firstName: gallery.name, secondName: secondName, wallets: gallery.userWallets, isNeedShowMoreButton: false, itemId: gallery.galleryId, children: (0, jsx_runtime_1.jsxs)(index_1.Flex, { alignItems: "flex-end", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(CardCategory_1.default, { label: gallery.label }), (0, jsx_runtime_1.jsx)(CardLikes_1.default, { isLiked: false, likes: 0 })] }) })] }) }));
|
|
123
123
|
};
|
|
124
124
|
// Export
|
|
125
125
|
exports.default = MultiMediaCard;
|