@ludo.ninja/components 2.2.37 → 2.2.39
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-search/queries/useFetchAllCreations/index.d.ts +7 -7
- package/build/api/server-search/queries/useFetchAllCreations/index.js +7 -10
- package/build/api/server-search/queries/useFetchCollections/index.d.ts +6 -6
- package/build/api/server-search/queries/useFetchCollections/index.js +10 -12
- package/build/api/server-search/queries/useFetchDynamicCollectionData/index.d.ts +4 -4
- package/build/api/server-search/queries/useFetchDynamicCollectionData/index.js +8 -11
- package/build/api/server-search/queries/useFindCreations/index.d.ts +7 -7
- package/build/api/server-search/queries/useFindCreations/index.js +9 -12
- package/build/api/server-search/queries/useFindUserCreations/index.d.ts +3 -3
- package/build/api/server-search/queries/useFindUserCreations/index.js +7 -10
- package/build/api/server-search/queries/useFindUserLudoCreations/index.d.ts +3 -3
- package/build/api/server-search/queries/useFindUserLudoCreations/index.js +7 -10
- package/build/components/gallery/add/addCreationToGallery/index.js +7 -7
- package/build/components/search/SearchInputContainer.d.ts +1 -1
- package/build/components/search/SearchInputContainer.js +14 -17
- package/build/entities/creation/collectionCreationBuilder.d.ts +2 -2
- package/build/entities/creation/collectionCreationBuilder.js +4 -3
- package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.d.ts +2 -3
- package/build/hooks/favorites/useGetFavoriteGallaryCreations/index.js +7 -9
- package/build/hooks/favorites/useGetUserFevoritesCreations/index.d.ts +3 -4
- package/build/hooks/favorites/useGetUserFevoritesCreations/index.js +6 -9
- package/build/hooks/galleries/useGetUserGalleriesCreations/index.d.ts +3 -4
- package/build/hooks/galleries/useGetUserGalleriesCreations/index.js +6 -9
- package/build/hooks/likes/dynamic/useFindCollectionsAndLikes.d.ts +6 -6
- package/build/hooks/likes/dynamic/useFindCollectionsAndLikes.js +15 -17
- package/build/hooks/likes/dynamic/useFindCreationsAndLikes.d.ts +4 -4
- package/build/hooks/likes/dynamic/useFindCreationsAndLikes.js +12 -15
- package/build/hooks/likes/dynamic/useGetCollectionInfoAndLikes.d.ts +4 -4
- package/build/hooks/likes/dynamic/useGetCollectionInfoAndLikes.js +11 -18
- package/build/hooks/likes/dynamic/useGetCreationsAndLikes.d.ts +4 -5
- package/build/hooks/likes/dynamic/useGetCreationsAndLikes.js +12 -17
- package/build/hooks/likes/dynamic/useGetCreationsAndLikesByType.d.ts +4 -4
- package/build/hooks/likes/dynamic/useGetCreationsAndLikesByType.js +16 -19
- package/build/hooks/likes/dynamic/useGetMixedLikesFavoriteList.d.ts +4 -5
- package/build/hooks/likes/dynamic/useGetMixedLikesFavoriteList.js +9 -10
- package/build/hooks/likes/dynamic/useGetTableLikes.d.ts +4 -5
- package/build/hooks/likes/dynamic/useGetTableLikes.js +14 -21
- package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.d.ts +2 -2
- package/build/modules/gallery/api/useGetAssetsAndCollectionForFavorite.js +7 -10
- package/build/modules/gallery/ui/itemsPreview/index.d.ts +2 -3
- package/build/modules/gallery/ui/itemsPreview/index.js +9 -4
- package/build/modules/gallery/useToGalleryAsset.d.ts +5 -5
- package/build/modules/gallery/useToGalleryAsset.js +7 -7
- package/build/modules/virtuoso/types.d.ts +0 -3
- package/build/system/Cards/CreationCard/CardHead.d.ts +2 -3
- package/build/system/Cards/CreationCard/CardHead.js +5 -14
- package/build/system/Cards/CreationCard/index.d.ts +2 -2
- package/build/system/Cards/CreationCard/index.js +7 -6
- package/build/system/Cards/MultiMediaCard/index.d.ts +3 -4
- package/build/system/Cards/MultiMediaCard/index.js +5 -4
- package/build/utils/extractItemIds.d.ts +2 -2
- package/build/utils/extractItemIds.js +1 -7
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { TCreation } from '../../../entities/creation/types';
|
|
1
2
|
import { TGallery } from '../../../entities/gallery/types';
|
|
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 = {
|
|
@@ -12,7 +12,7 @@ export interface ICheckboxState {
|
|
|
12
12
|
}
|
|
13
13
|
export interface ICreationCard {
|
|
14
14
|
creationName?: string;
|
|
15
|
-
creation:
|
|
15
|
+
creation: TCreation;
|
|
16
16
|
isNeedHeight: boolean;
|
|
17
17
|
likesDynamicInfo?: schema.IDynamicAssetData | schema.IDynamicCollectionData;
|
|
18
18
|
toolsForRemove?: RemoveToolsType | undefined;
|
|
@@ -28,6 +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 CreationMediaView_1 = require("../../../entities/creation/CreationMediaView");
|
|
31
32
|
const types_1 = require("../../../entities/labelCreationType/types");
|
|
32
33
|
const likes_1 = __importDefault(require("../../../hooks/likes"));
|
|
33
34
|
const env_1 = require("../../../store/env");
|
|
@@ -99,9 +100,9 @@ const CreationCard = ({ creationName, creation, isNeedHeight, likesDynamicInfo,
|
|
|
99
100
|
const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
|
|
100
101
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
101
102
|
const { likes, addLike, deleteLike } = (0, likes_1.default)({
|
|
102
|
-
defaultLikesCount: likesDynamicInfo?.likesNum || creation.
|
|
103
|
-
defaultIsLiked: likesDynamicInfo?.isLikedByUser || creation.
|
|
104
|
-
itemType: creation.
|
|
103
|
+
defaultLikesCount: likesDynamicInfo?.likesNum || creation.likes,
|
|
104
|
+
defaultIsLiked: likesDynamicInfo?.isLikedByUser || creation.isLiked,
|
|
105
|
+
itemType: creation.itemType,
|
|
105
106
|
removeOnDislike: toolsForRemove,
|
|
106
107
|
isLoadingLikes,
|
|
107
108
|
});
|
|
@@ -109,10 +110,10 @@ const CreationCard = ({ creationName, creation, isNeedHeight, likesDynamicInfo,
|
|
|
109
110
|
const isHideProd = isProd();
|
|
110
111
|
const HideLink = isHideProd ? react_1.default.Fragment : link_1.default;
|
|
111
112
|
const getLink = (href) => {
|
|
112
|
-
if (creation.
|
|
113
|
+
if (creation.itemType === types_1.LabelKeys.asset) {
|
|
113
114
|
return `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["asset"]}/${href.replace(`/${types_1.LabelKeys.asset}/`, "")}`;
|
|
114
115
|
}
|
|
115
|
-
if (creation.
|
|
116
|
+
if (creation.itemType === types_1.LabelKeys.collection) {
|
|
116
117
|
return `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["collections"]}/${href.replace(`/${types_1.LabelKeys.collection}/`, "")}`;
|
|
117
118
|
}
|
|
118
119
|
return href;
|
|
@@ -123,7 +124,7 @@ const CreationCard = ({ creationName, creation, isNeedHeight, likesDynamicInfo,
|
|
|
123
124
|
// } else {
|
|
124
125
|
// window.open(`${domain}/rewards/${userId}`,'_self');
|
|
125
126
|
// }
|
|
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.
|
|
127
|
+
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.creationLink), children: [(0, jsx_runtime_1.jsxs)(Head_1.default, { children: [(0, jsx_runtime_1.jsx)(CreationMediaView_1.CreationMediaView, { media: creation.media }), (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.creatorAddress, secondName: creation.name, cuttedSecondName: creation.getCuttedSecondName(!isMobile), itemId: creation.itemId, isNeedShowMoreButton: isHideProd ? false : !!isNeedShowMoreButton, href: getLink(creation.creationLink), 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.label }), !isHideProd &&
|
|
127
128
|
(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
129
|
};
|
|
129
130
|
exports.CreationCard = CreationCard;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import CreationEntity from '../../../dto/CreationEntity';
|
|
1
|
+
import { TCreation } from '../../../entities/creation/types';
|
|
3
2
|
import { TGallery } from '../../../entities/gallery/types';
|
|
4
3
|
declare const MultiMediaCard: ({ gallery, assets, collections, }: {
|
|
5
4
|
gallery: TGallery;
|
|
6
|
-
assets:
|
|
7
|
-
collections:
|
|
5
|
+
assets: TCreation[] | null;
|
|
6
|
+
collections: TCreation[] | null;
|
|
8
7
|
}) => import("react/jsx-runtime").JSX.Element;
|
|
9
8
|
export default MultiMediaCard;
|
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
7
|
const CardCategory_1 = __importDefault(require("../CardContent/CardCategory"));
|
|
8
8
|
const CardImage_1 = __importDefault(require("../CardMedia/CardImage"));
|
|
9
|
+
const CreationMediaView_1 = require("../../../entities/creation/CreationMediaView");
|
|
9
10
|
const env_1 = require("../../../store/env");
|
|
10
11
|
const ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
11
12
|
const colors_1 = require("../../../styles/colors");
|
|
@@ -101,14 +102,14 @@ const MultiMediaCard = ({ gallery, assets, collections, }) => {
|
|
|
101
102
|
for (let i = 0; i < 4; i++) {
|
|
102
103
|
const creationId = galleryCreationIds[i];
|
|
103
104
|
const asset = assets?.find((asset) => {
|
|
104
|
-
return creationId === asset.
|
|
105
|
+
return creationId === asset.creationId;
|
|
105
106
|
});
|
|
106
|
-
const collection = collections?.find((collection) => collection.
|
|
107
|
+
const collection = collections?.find((collection) => collection.creationId === creationId?.split(".").splice(1).join("."));
|
|
107
108
|
if (asset) {
|
|
108
|
-
cardsMedia.push(mediaTemplate(i,
|
|
109
|
+
cardsMedia.push(mediaTemplate(i, (0, jsx_runtime_1.jsx)(CreationMediaView_1.CreationMediaView, { media: asset.media })));
|
|
109
110
|
}
|
|
110
111
|
else if (collection) {
|
|
111
|
-
cardsMedia.push(mediaTemplate(i, (0, jsx_runtime_1.jsx)(CardImage_1.default, { alt: `${collection.
|
|
112
|
+
cardsMedia.push(mediaTemplate(i, (0, jsx_runtime_1.jsx)(CardImage_1.default, { alt: `${collection.name} ${collection.address || ""}`, imgSrc: collection.originalUrls?.[0] ?? "", errorImg: `${constants_1.staticLink}/public/noContent/noContent.svg` })));
|
|
112
113
|
}
|
|
113
114
|
else {
|
|
114
115
|
cardsMedia.push(mediaTemplate(i, (0, jsx_runtime_1.jsx)("img", { src: `${constants_1.staticLink}/public/gallery/defaultImage.svg`, alt: "gallery_default", className: "svg" })));
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare function extractItemIds(creations:
|
|
1
|
+
import { TCreation } from '../entities/creation/types';
|
|
2
|
+
export declare function extractItemIds(creations: TCreation[]): string[];
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.extractItemIds = extractItemIds;
|
|
7
|
-
const CollectionCreationEntity_1 = __importDefault(require("../dto/Collection/CollectionCreationEntity"));
|
|
8
4
|
function extractItemIds(creations) {
|
|
9
|
-
return creations.map((creation) => creation
|
|
10
|
-
? creation.getCreationId()
|
|
11
|
-
: creation.getItemId());
|
|
5
|
+
return creations.map((creation) => creation.itemId);
|
|
12
6
|
}
|