@ludo.ninja/components 2.1.11 → 2.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ReactNode } from "react";
|
|
1
2
|
import { searchSchema as schema } from "@ludo.ninja/api";
|
|
2
3
|
import GalleryEntityV2 from '../../../dto/GalleryEntityV2';
|
|
3
4
|
import { TCreationAndCollection } from '../../../modules/virtuoso/types';
|
|
@@ -7,8 +8,7 @@ export type RemoveToolsType = {
|
|
|
7
8
|
};
|
|
8
9
|
export interface ICheckboxState {
|
|
9
10
|
isShowCheckbox?: boolean;
|
|
10
|
-
|
|
11
|
-
toggleCreationToGallery?: (creation: TCreationAndCollection) => void;
|
|
11
|
+
checkboxSlot?: ReactNode;
|
|
12
12
|
}
|
|
13
13
|
export interface ICreationCard {
|
|
14
14
|
creationName?: string;
|
|
@@ -23,4 +23,4 @@ export interface ICreationCard {
|
|
|
23
23
|
isRegularCard?: boolean;
|
|
24
24
|
currentMyGalleryId?: false | string;
|
|
25
25
|
}
|
|
26
|
-
export declare const CreationCard: ({ creationName, creation, isNeedHeight, likesDynamicInfo, toolsForRemove, isMobile, isLoadingLikes, isNeedShowMoreButton, isUserProfile, isRegularCard, isShowCheckbox,
|
|
26
|
+
export declare const CreationCard: ({ creationName, creation, isNeedHeight, likesDynamicInfo, toolsForRemove, isMobile, isLoadingLikes, isNeedShowMoreButton, isUserProfile, isRegularCard, isShowCheckbox, checkboxSlot, currentMyGalleryId, }: ICreationCard & ICheckboxState) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -39,7 +39,7 @@ const colors_1 = require("../../../styles/colors");
|
|
|
39
39
|
const boxShadow_1 = __importDefault(require("../../../styles/mixins/boxShadow"));
|
|
40
40
|
const boxTransform_1 = __importDefault(require("../../../styles/mixins/boxTransform"));
|
|
41
41
|
const index_1 = require("../../index");
|
|
42
|
-
|
|
42
|
+
// import CardCheckBox from "@/system/Cards/CardCheckbox";
|
|
43
43
|
const CardContent_1 = __importDefault(require("../CardContent"));
|
|
44
44
|
const CardCategory_1 = __importDefault(require("../CardContent/CardCategory"));
|
|
45
45
|
const CardLikes_1 = __importDefault(require("../CardContent/CardLikes"));
|
|
@@ -96,7 +96,7 @@ const StyledRegularCard = styled_components_1.default.div `
|
|
|
96
96
|
}
|
|
97
97
|
`;
|
|
98
98
|
// Component
|
|
99
|
-
const CreationCard = ({ creationName, creation, isNeedHeight, likesDynamicInfo, toolsForRemove, isMobile, isLoadingLikes, isNeedShowMoreButton, isUserProfile, isRegularCard = true, isShowCheckbox,
|
|
99
|
+
const CreationCard = ({ creationName, creation, isNeedHeight, likesDynamicInfo, toolsForRemove, isMobile, isLoadingLikes, isNeedShowMoreButton, isUserProfile, isRegularCard = true, isShowCheckbox, checkboxSlot, currentMyGalleryId, }) => {
|
|
100
100
|
const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
|
|
101
101
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
102
102
|
const { likes, addLike, deleteLike } = (0, likes_1.default)({
|
|
@@ -121,11 +121,7 @@ const CreationCard = ({ creationName, creation, isNeedHeight, likesDynamicInfo,
|
|
|
121
121
|
// } else {
|
|
122
122
|
// window.open(`${domain}/rewards/${userId}`,'_self');
|
|
123
123
|
// }
|
|
124
|
-
return ((0, jsx_runtime_1.jsxs)(StyledRegularCard, { isNeedHeight: isNeedHeight, isNeedTransform: isNeedShowMoreButton, isShowCheckbox: isShowCheckbox, children: [isShowCheckbox && ((0, jsx_runtime_1.
|
|
125
|
-
console.log("CardCheckBox", toggleCreationToGallery);
|
|
126
|
-
console.log("toggleCreationToGallery", creation);
|
|
127
|
-
toggleCreationToGallery?.(creation);
|
|
128
|
-
} })), (0, jsx_runtime_1.jsxs)(HideLink, { className: "linkRegularCard", href: getLink(creation.getCreationLink()), children: [(0, jsx_runtime_1.jsxs)(Head_1.default, { children: [creation.detectMediaType().displaySingleMedia(), (0, jsx_runtime_1.jsx)(CardHead_1.CardHead, { isRegularCard: !!isRegularCard, isIconLiked: likes.isLiked, creation: creation, addLikeToCard: addLike, deleteLikeFromCard: deleteLike, isUserProfile: isUserProfile || false, isDisabled: !!isLoadingLikes, isShowCheckbox: isShowCheckbox, currentMyGalleryId: currentMyGalleryId })] }), (0, jsx_runtime_1.jsx)(CardContent_1.default, { creationName: creationName, firstName: creation.getCreatorAddress(), secondName: creation.getName(), cuttedSecondName: creation.getCuttedSecondName(!isMobile), itemId: creation.getItemId(), isNeedShowMoreButton: isNeedShowMoreButton || false, href: creation.getCreationLink(), children: (0, jsx_runtime_1.jsxs)(index_1.Flex, { alignItems: "end", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(CardCategory_1.default, { label: creation.getLabel() }), !isProd() &&
|
|
124
|
+
return ((0, jsx_runtime_1.jsxs)(StyledRegularCard, { isNeedHeight: isNeedHeight, isNeedTransform: isNeedShowMoreButton, isShowCheckbox: isShowCheckbox, children: [isShowCheckbox && checkboxSlot, (0, jsx_runtime_1.jsxs)(HideLink, { className: "linkRegularCard", href: getLink(creation.getCreationLink()), children: [(0, jsx_runtime_1.jsxs)(Head_1.default, { children: [creation.detectMediaType().displaySingleMedia(), (0, jsx_runtime_1.jsx)(CardHead_1.CardHead, { isRegularCard: !!isRegularCard, isIconLiked: likes.isLiked, creation: creation, addLikeToCard: addLike, deleteLikeFromCard: deleteLike, isUserProfile: isUserProfile || false, isDisabled: !!isLoadingLikes, isShowCheckbox: isShowCheckbox, currentMyGalleryId: currentMyGalleryId })] }), (0, jsx_runtime_1.jsx)(CardContent_1.default, { creationName: creationName, firstName: creation.getCreatorAddress(), secondName: creation.getName(), cuttedSecondName: creation.getCuttedSecondName(!isMobile), itemId: creation.getItemId(), isNeedShowMoreButton: isNeedShowMoreButton || false, href: creation.getCreationLink(), children: (0, jsx_runtime_1.jsxs)(index_1.Flex, { alignItems: "end", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(CardCategory_1.default, { label: creation.getLabel() }), !isProd() &&
|
|
129
125
|
(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 })))] }) })] })] }));
|
|
130
126
|
};
|
|
131
127
|
exports.CreationCard = CreationCard;
|