@ludo.ninja/components 2.2.27 → 2.2.29

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,6 +1,4 @@
1
- import AssetEntity from '../../../dto/AssetEntity';
2
- type InformationProps = {
3
- asset: AssetEntity;
4
- };
5
- export declare const Category: ({ asset }: InformationProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
1
+ import { TAsset } from '../../../entities/asset/types';
2
+ export declare const Category: ({ asset }: {
3
+ asset: TAsset;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -5,14 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Category = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const link_1 = __importDefault(require("next/link"));
9
- const styled_components_1 = __importDefault(require("styled-components"));
10
- const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
8
+ const vars_1 = require("../../../fonts/vars");
9
+ const env_1 = require("../../../store/env");
11
10
  const ScreenWidth_1 = require("../../../styles/ScreenWidth");
12
11
  const index_1 = require("../../../system/index");
13
- const vars_1 = require("../../../fonts/vars");
14
12
  const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
15
- const env_1 = require("../../../store/env");
13
+ const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
14
+ const link_1 = __importDefault(require("next/link"));
15
+ const styled_components_1 = __importDefault(require("styled-components"));
16
16
  // Styles
17
17
  const StyledBox = (0, styled_components_1.default)(index_1.Box) `
18
18
  text-align: center;
@@ -50,9 +50,9 @@ const StyledText = (0, styled_components_1.default)(index_1.Text) `
50
50
  `;
51
51
  const Category = ({ asset }) => {
52
52
  //update
53
- const category = asset.getCategory() ?? 'all';
54
- const categoryLabel = asset.getCategoryLabel() ?? 'All';
53
+ const category = asset.category ?? "all";
54
+ const categoryLabel = asset.categoryLabel ?? "All";
55
55
  const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
56
- return ((0, jsx_runtime_1.jsx)(link_1.default, { style: { display: 'block', width: 'max-content' }, href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["search"]}/nfts?category=${category}`, children: (0, jsx_runtime_1.jsx)(StyledBox, { children: (0, jsx_runtime_1.jsx)(StyledText, { children: categoryLabel }) }) }));
56
+ return ((0, jsx_runtime_1.jsx)(link_1.default, { style: { display: "block", width: "max-content" }, href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["search"]}/nfts?category=${category}`, children: (0, jsx_runtime_1.jsx)(StyledBox, { children: (0, jsx_runtime_1.jsx)(StyledText, { children: categoryLabel }) }) }));
57
57
  };
58
58
  exports.Category = Category;
@@ -1,6 +1,4 @@
1
- import AssetEntity from '../../../dto/AssetEntity';
2
- type InformationProps = {
3
- asset: AssetEntity;
4
- };
5
- export declare const Information: ({ asset }: InformationProps) => import("react/jsx-runtime").JSX.Element;
6
- export {};
1
+ import { TAsset } from '../../../entities/asset/types';
2
+ export declare const Information: ({ asset }: {
3
+ asset: TAsset;
4
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -5,24 +5,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.Information = void 0;
7
7
  const jsx_runtime_1 = require("react/jsx-runtime");
8
- const link_1 = __importDefault(require("next/link"));
9
- const moment_1 = __importDefault(require("moment"));
10
- const styled_components_1 = __importDefault(require("styled-components"));
11
- const colors_1 = require("@ludo.ninja/ui/build/styles/colors");
12
- const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
13
- const utils_1 = require("@ludo.ninja/utils");
8
+ const vars_1 = require("../../../fonts/vars");
14
9
  const env_1 = require("../../../store/env");
15
10
  const ScreenWidth_1 = require("../../../styles/ScreenWidth");
16
- const colors_2 = require("../../../styles/colors");
11
+ const colors_1 = require("../../../styles/colors");
17
12
  const index_1 = require("../../../system/index");
18
13
  const copyBtn_1 = require("../../../utils/copyBtn");
19
14
  const screen_1 = require("../../../utils/screen");
20
- const vars_1 = require("../../../fonts/vars");
21
15
  const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
16
+ const colors_2 = require("@ludo.ninja/ui/build/styles/colors");
17
+ const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
18
+ const utils_1 = require("@ludo.ninja/utils");
19
+ const moment_1 = __importDefault(require("moment"));
20
+ const link_1 = __importDefault(require("next/link"));
21
+ const styled_components_1 = __importDefault(require("styled-components"));
22
22
  const StyledImage = styled_components_1.default.img `
23
23
  border-radius: 50%;
24
24
  width: 16px;
25
25
  height: 16px;
26
+
26
27
  ${ScreenWidth_1.mediaQuery.minWidthFourK} {
27
28
  width: ${(0, _4k_1.adaptiveValueCalc)(16)};
28
29
  height: ${(0, _4k_1.adaptiveValueCalc)(16)};
@@ -68,7 +69,7 @@ const SBlockchain = (0, styled_components_1.default)(index_1.Flex) `
68
69
  gap: 6px;
69
70
 
70
71
  p {
71
- color: ${colors_1.BlackColor};
72
+ color: ${colors_2.BlackColor};
72
73
  font-family: ${vars_1.poppinsFontVarCss.css};
73
74
  font-size: 15px;
74
75
  font-weight: 500;
@@ -99,21 +100,15 @@ const SFlex = (0, styled_components_1.default)(index_1.Flex) `
99
100
  `;
100
101
  const Information = ({ asset }) => {
101
102
  const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
102
- const tokenId = asset.getTokenId();
103
- const splittedAssetId = asset.getSplitedAssetId();
104
- const address = asset.getAddress();
105
- const blockChain = asset.getBlockchain();
106
- const blockTimestamp = asset.getBlockTimestamp();
107
- const id = tokenId ? tokenId : splittedAssetId;
108
- const idTittle = tokenId ? 'Token ID' : 'ID';
103
+ const { tokenId, splitedAssetId: splittedAssetId, address, blockchain: blockChain, blockTimestamp } = asset;
104
+ const id = tokenId || splittedAssetId;
105
+ const idTittle = tokenId ? "Token ID" : "ID";
109
106
  const { deviceType } = (0, screen_1.useWindowDimensions)();
110
- const isDesktop = deviceType === 'isDesktop';
111
- const styleOverflow = isDesktop
112
- ? { overflow: 'hidden' }
113
- : undefined;
107
+ const isDesktop = deviceType === "isDesktop";
108
+ const styleOverflow = isDesktop ? { overflow: "hidden" } : undefined;
114
109
  const getStaticENVDomain = (0, env_1.useEnvStore)((state) => state.getStaticDomain);
115
- return ((0, jsx_runtime_1.jsxs)(index_1.Flex, { flexDirection: "column", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsxs)(SFlex, { justifyContent: "space-between", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_2.TextGrayColor, children: "Blockchain" }), (0, jsx_runtime_1.jsx)(link_1.default, { href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["search"]}/nfts?blockchain=${blockChain.getBlockChainPrivateLabel()}`, children: (0, jsx_runtime_1.jsxs)(SBlockchain, { children: [(0, jsx_runtime_1.jsx)("p", { children: blockChain.getBlockChainPublicLabel() }), (0, jsx_runtime_1.jsx)(StyledImage, { width: 16, height: 16, src: blockChain.getBlockChainIconRegular({
110
+ return ((0, jsx_runtime_1.jsxs)(index_1.Flex, { flexDirection: "column", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsxs)(SFlex, { justifyContent: "space-between", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_1.TextGrayColor, children: "Blockchain" }), (0, jsx_runtime_1.jsx)(link_1.default, { href: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["search"]}/nfts?blockchain=${blockChain.getBlockChainPrivateLabel()}`, children: (0, jsx_runtime_1.jsxs)(SBlockchain, { children: [(0, jsx_runtime_1.jsx)("p", { children: blockChain.getBlockChainPublicLabel() }), (0, jsx_runtime_1.jsx)(StyledImage, { width: 16, height: 16, src: blockChain.getBlockChainIconRegular({
116
111
  domain: getStaticENVDomain(),
117
- }), alt: blockChain.getBlockChainPublicLabel() })] }) })] }), address && ((0, jsx_runtime_1.jsxs)(FlexOverflow, { children: [(0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_2.TextGrayColor, children: "Contract Address" }), (0, jsx_runtime_1.jsx)(copyBtn_1.CopyButton, { value: address, style: styleOverflow, children: isDesktop ? ((0, jsx_runtime_1.jsx)(OverflowH5, { color: colors_2.AccentColor, title: address, children: address })) : ((0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_2.AccentColor, title: address, children: (0, utils_1.shortenedText)(address) })) })] })), (0, jsx_runtime_1.jsxs)(FlexOverflow, { children: [(0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_2.TextGrayColor, children: idTittle }), (0, jsx_runtime_1.jsx)(copyBtn_1.CopyButton, { value: id, style: styleOverflow, children: isDesktop ? ((0, jsx_runtime_1.jsx)(OverflowH5, { color: colors_2.AccentColor, title: id, children: id })) : ((0, jsx_runtime_1.jsx)(BoxOverflow, { children: (0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_2.AccentColor, title: id, children: (0, jsx_runtime_1.jsx)(BoxOverflow, { children: id }) }) })) })] }), blockTimestamp && ((0, jsx_runtime_1.jsxs)(SFlex, { justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_2.TextGrayColor, children: "Added on" }), (0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_2.TextGrayColor, children: (0, moment_1.default)(blockTimestamp * 1000).format('LL') })] }))] }));
112
+ }), alt: blockChain.getBlockChainPublicLabel() })] }) })] }), address && ((0, jsx_runtime_1.jsxs)(FlexOverflow, { children: [(0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_1.TextGrayColor, children: "Contract Address" }), (0, jsx_runtime_1.jsx)(copyBtn_1.CopyButton, { value: address, style: styleOverflow, children: isDesktop ? ((0, jsx_runtime_1.jsx)(OverflowH5, { color: colors_1.AccentColor, title: address, children: address })) : ((0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_1.AccentColor, title: address, children: (0, utils_1.shortenedText)(address) })) })] })), (0, jsx_runtime_1.jsxs)(FlexOverflow, { children: [(0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_1.TextGrayColor, children: idTittle }), (0, jsx_runtime_1.jsx)(copyBtn_1.CopyButton, { value: id, style: styleOverflow, children: isDesktop ? ((0, jsx_runtime_1.jsx)(OverflowH5, { color: colors_1.AccentColor, title: id, children: id })) : ((0, jsx_runtime_1.jsx)(BoxOverflow, { children: (0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_1.AccentColor, title: id, children: (0, jsx_runtime_1.jsx)(BoxOverflow, { children: id }) }) })) })] }), blockTimestamp && ((0, jsx_runtime_1.jsxs)(SFlex, { justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_1.TextGrayColor, children: "Added on" }), (0, jsx_runtime_1.jsx)(index_1.H5, { color: colors_1.TextGrayColor, children: (0, moment_1.default)(blockTimestamp * 1000).format("LL") })] }))] }));
118
113
  };
119
114
  exports.Information = Information;
@@ -1,4 +1,5 @@
1
1
  interface IShareDialog {
2
+ shareMyProfileLink?: string;
2
3
  link: string | null;
3
4
  onHide: () => void;
4
5
  params?: {
@@ -29,5 +30,5 @@ interface IShareDialog {
29
30
  };
30
31
  };
31
32
  }
32
- declare const ShareDialog: ({ link, onHide, params }: IShareDialog) => import("react/jsx-runtime").JSX.Element;
33
+ declare const ShareDialog: ({ link, onHide, params, shareMyProfileLink }: IShareDialog) => import("react/jsx-runtime").JSX.Element;
33
34
  export default ShareDialog;
@@ -18,6 +18,7 @@ const styled_components_1 = __importDefault(require("styled-components"));
18
18
  const STitle = (0, styled_components_1.default)(index_1.H1) `
19
19
  margin-bottom: 24px;
20
20
  color: ${colors_1.BlackColor};
21
+
21
22
  ${ScreenWidth_1.mediaQuery.minWidthFourK} {
22
23
  margin-bottom: ${(0, _4k_1.adaptiveValueCalc)(24)};
23
24
  }
@@ -73,10 +74,10 @@ const StyledShare = styled_components_1.default.div `
73
74
  }
74
75
  }
75
76
  `;
76
- const ShareDialog = ({ link, onHide, params }) => {
77
+ const ShareDialog = ({ link, onHide, params, shareMyProfileLink }) => {
77
78
  const url = new URL(link || "");
78
79
  url.search = "";
79
- const urlWithoutGetParameters = url.toString();
80
+ const urlWithoutGetParameters = shareMyProfileLink || url.toString();
80
81
  const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
81
82
  return ((0, jsx_runtime_1.jsxs)(StyledShare, { children: [(0, jsx_runtime_1.jsx)(index_1.Flex, { alignItems: "center", justifyContent: "center", children: (0, jsx_runtime_1.jsx)(STitle, { children: "Share to..." }) }), (0, jsx_runtime_1.jsxs)("div", { className: "shareButtons", children: [(0, jsx_runtime_1.jsxs)("button", { onClick: () => {
82
83
  onHide();
@@ -3,22 +3,22 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AssetMediasOpengraph = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const Urls_1 = require("../../dto/common/Media/Urls");
6
- const types_1 = require("./types");
7
- const utils_1 = require("./utils");
6
+ const getMediaVariant_1 = require("../media/getMediaVariant");
7
+ const types_1 = require("../media/types");
8
8
  const env_1 = require("../../store/env");
9
9
  const AssetMediasOpengraph = ({ medias, alt }) => {
10
10
  return [medias[0]].map((media) => {
11
- const assetVariant = (0, utils_1.getAssetMediaVariant)({ media });
12
- switch (assetVariant) {
13
- case types_1.EAssetVariants.audio:
11
+ const mediaVariant = (0, getMediaVariant_1.getMediaVariant)({ media });
12
+ switch (mediaVariant) {
13
+ case types_1.EMediaVariants.audio:
14
14
  return (0, jsx_runtime_1.jsx)(AudioOpengraph, { media: media });
15
- case types_1.EAssetVariants.video:
15
+ case types_1.EMediaVariants.video:
16
16
  return (0, jsx_runtime_1.jsx)(VideoOpengraph, { media: media });
17
- case types_1.EAssetVariants.object3d:
17
+ case types_1.EMediaVariants.object3d:
18
18
  return (0, jsx_runtime_1.jsx)(Object3DOpengraph, { media: media, alt: alt });
19
- case types_1.EAssetVariants.other:
20
- case types_1.EAssetVariants.image:
21
- case types_1.EAssetVariants.screenshot:
19
+ case types_1.EMediaVariants.other:
20
+ case types_1.EMediaVariants.image:
21
+ case types_1.EMediaVariants.screenshot:
22
22
  default:
23
23
  return (0, jsx_runtime_1.jsx)(ImageOpengraph, { media: media, alt: alt });
24
24
  }
@@ -9,25 +9,25 @@ const assetPage_1 = require("../../components/assetPage");
9
9
  const AssetImage_1 = __importDefault(require("../../components/assetPage/media/AssetImage"));
10
10
  const AssetImage_2 = __importDefault(require("../../components/assetPage/media/AssetImage"));
11
11
  const Urls_1 = require("../../dto/common/Media/Urls");
12
- const types_1 = require("./types");
13
- const utils_1 = require("./utils");
12
+ const getMediaVariant_1 = require("../media/getMediaVariant");
13
+ const types_1 = require("../media/types");
14
14
  const env_1 = require("../../store/env");
15
15
  const constants_1 = require("@ludo.ninja/core/build/constants");
16
16
  const AssetMediasViews = ({ medias }) => {
17
17
  return medias.map((media) => {
18
- const assetVariant = (0, utils_1.getAssetMediaVariant)({ media });
19
- switch (assetVariant) {
20
- case types_1.EAssetVariants.image:
18
+ const mediaVariant = (0, getMediaVariant_1.getMediaVariant)({ media });
19
+ switch (mediaVariant) {
20
+ case types_1.EMediaVariants.image:
21
21
  return (0, jsx_runtime_1.jsx)(AssetImageMediaView, { media: media });
22
- case types_1.EAssetVariants.audio:
22
+ case types_1.EMediaVariants.audio:
23
23
  return (0, jsx_runtime_1.jsx)(AssetAudioMediaView, { media: media });
24
- case types_1.EAssetVariants.screenshot:
24
+ case types_1.EMediaVariants.screenshot:
25
25
  return (0, jsx_runtime_1.jsx)(AssetImageMediaView, { media: media, isScreenshot: true });
26
- case types_1.EAssetVariants.video:
26
+ case types_1.EMediaVariants.video:
27
27
  return (0, jsx_runtime_1.jsx)(AssetVideoMediaView, { media: media });
28
- case types_1.EAssetVariants.object3d:
28
+ case types_1.EMediaVariants.object3d:
29
29
  return (0, jsx_runtime_1.jsx)(assetPage_1.Viewer3D, { file3D: media.originalUrl, file2D: "" });
30
- case types_1.EAssetVariants.other:
30
+ case types_1.EMediaVariants.other:
31
31
  return (0, jsx_runtime_1.jsx)(AssetOtherMediaView, { media: media });
32
32
  default:
33
33
  return ((0, jsx_runtime_1.jsx)(AssetImage_2.default, { alt: media.alt, imageUrl: "/noContent/noContent.svg", errorImg: "/noContent/noContent.svg" }));
@@ -39,11 +39,3 @@ export type TAsset = {
39
39
  }[];
40
40
  assetLink: string;
41
41
  };
42
- export declare enum EAssetVariants {
43
- audio = "audio",
44
- image = "image",
45
- object3d = "object3d",
46
- other = "other",
47
- screenshot = "screenshot",
48
- video = "video"
49
- }
@@ -1,12 +1,2 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EAssetVariants = void 0;
4
- var EAssetVariants;
5
- (function (EAssetVariants) {
6
- EAssetVariants["audio"] = "audio";
7
- EAssetVariants["image"] = "image";
8
- EAssetVariants["object3d"] = "object3d";
9
- EAssetVariants["other"] = "other";
10
- EAssetVariants["screenshot"] = "screenshot";
11
- EAssetVariants["video"] = "video";
12
- })(EAssetVariants || (exports.EAssetVariants = EAssetVariants = {}));
@@ -0,0 +1,4 @@
1
+ import { EMediaVariants, IMedia } from './types';
2
+ export declare const getMediaVariant: ({ media }: {
3
+ media: IMedia;
4
+ }) => EMediaVariants;
@@ -1,44 +1,44 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getAssetMediaVariant = void 0;
3
+ exports.getMediaVariant = void 0;
4
4
  const types_1 = require("./types");
5
5
  const _3d_1 = require("../../utils/3d");
6
6
  const core_1 = require("@ludo.ninja/core");
7
- const getAssetMediaVariant = ({ media }) => {
7
+ const getMediaVariant = ({ media }) => {
8
8
  if ((0, core_1.isImage)({
9
9
  media: media.media,
10
10
  mimeType: media.mimeType,
11
11
  originalMimeType: media.originalMime,
12
12
  })) {
13
- return types_1.EAssetVariants.image;
13
+ return types_1.EMediaVariants.image;
14
14
  }
15
15
  if ((0, core_1.isAudio)({
16
16
  media: media.media,
17
17
  mimeType: media.mimeType,
18
18
  originalMimeType: media.originalMime,
19
19
  })) {
20
- return types_1.EAssetVariants.audio;
20
+ return types_1.EMediaVariants.audio;
21
21
  }
22
22
  if ((0, core_1.isScreenshot)({
23
23
  media: media.media,
24
24
  mimeType: media.mimeType,
25
25
  originalMimeType: media.originalMime,
26
26
  })) {
27
- return types_1.EAssetVariants.screenshot;
27
+ return types_1.EMediaVariants.screenshot;
28
28
  }
29
29
  if ((0, core_1.isVideo)({
30
30
  media: media.media,
31
31
  mimeType: media.mimeType,
32
32
  originalMimeType: media.originalMime,
33
33
  })) {
34
- return types_1.EAssetVariants.video;
34
+ return types_1.EMediaVariants.video;
35
35
  }
36
36
  if ((0, _3d_1.isObject3D)({
37
37
  media: media.media,
38
38
  mimeType: media.mimeType,
39
39
  })) {
40
- return types_1.EAssetVariants.object3d;
40
+ return types_1.EMediaVariants.object3d;
41
41
  }
42
- return types_1.EAssetVariants.other;
42
+ return types_1.EMediaVariants.other;
43
43
  };
44
- exports.getAssetMediaVariant = getAssetMediaVariant;
44
+ exports.getMediaVariant = getMediaVariant;
@@ -7,3 +7,11 @@ export interface IMedia {
7
7
  alt: string;
8
8
  originalMime: null | string;
9
9
  }
10
+ export declare enum EMediaVariants {
11
+ audio = "audio",
12
+ image = "image",
13
+ object3d = "object3d",
14
+ other = "other",
15
+ screenshot = "screenshot",
16
+ video = "video"
17
+ }
@@ -1,2 +1,12 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EMediaVariants = void 0;
4
+ var EMediaVariants;
5
+ (function (EMediaVariants) {
6
+ EMediaVariants["audio"] = "audio";
7
+ EMediaVariants["image"] = "image";
8
+ EMediaVariants["object3d"] = "object3d";
9
+ EMediaVariants["other"] = "other";
10
+ EMediaVariants["screenshot"] = "screenshot";
11
+ EMediaVariants["video"] = "video";
12
+ })(EMediaVariants || (exports.EMediaVariants = EMediaVariants = {}));
@@ -2,31 +2,35 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ProfileDataInitialization = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const store_1 = require("../store");
6
+ const ui_1 = require("../../../store/ui");
5
7
  const api_1 = require("@ludo.ninja/api");
6
8
  const api_2 = require("@ludo.ninja/api");
7
9
  const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
8
- const store_1 = require("../store");
9
- const ui_1 = require("../../../store/ui");
10
10
  const FetcherMyProfile = ( /*{ userId }: { userId: string }*/) => {
11
11
  const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
12
12
  const { setIsLoadingProfileData, setProfileData,
13
13
  // profileData,
14
- setUserExp, setInviteCodes, } = (0, store_1.useUserStore)((state) => ({
14
+ setUserExp, setInviteCodes, setMyShareLink, } = (0, store_1.useUserStore)((state) => ({
15
15
  setIsLoadingProfileData: state.setIsLoadingProfileData,
16
16
  setProfileData: state.setProfileData,
17
17
  profileData: state.profileData,
18
18
  setUserExp: state.setUserExp,
19
19
  setInviteCodes: state.setInviteCodes,
20
+ setMyShareLink: state.setMyShareLink,
20
21
  }));
21
22
  // console.log('profileData', profileData);
22
23
  api_2.identitySchema.useFetchMyProfileV2Query({
23
24
  context: {
24
25
  uri: api_1.hosts.identityHost,
25
26
  },
27
+ fetchPolicy: "no-cache",
26
28
  onCompleted: ({ fetchMyProfileV2: fetchMyProfile }) => {
27
29
  // console.log('fetchMyProfile', fetchMyProfile);
28
30
  setProfileData(fetchMyProfile);
29
- setIsLoadingProfileData(false);
31
+ if (fetchMyProfile.shareLink) {
32
+ setMyShareLink(fetchMyProfile.shareLink);
33
+ }
30
34
  if (fetchMyProfile.xps) {
31
35
  setUserExp({
32
36
  levelMaxXps: fetchMyProfile.levelMaxXps,
@@ -38,6 +42,7 @@ const FetcherMyProfile = ( /*{ userId }: { userId: string }*/) => {
38
42
  if (fetchMyProfile.inviteCodes) {
39
43
  setInviteCodes(fetchMyProfile.inviteCodes);
40
44
  }
45
+ setIsLoadingProfileData(false);
41
46
  },
42
47
  onError: (err) => {
43
48
  openAlert({
@@ -1,9 +1,9 @@
1
- import { ApolloError } from '@apollo/client';
2
- import { experiencesSchema as schema } from '@ludo.ninja/api';
3
- import { identitySchema } from '@ludo.ninja/api';
4
- import { ProfileEntity } from '@ludo.ninja/core';
5
1
  import { IUser } from '../../entities/user/type';
6
- type TMyProfile = identitySchema.IFetchMyProfileV2Query['fetchMyProfileV2'];
2
+ import { ApolloError } from "@apollo/client";
3
+ import { experiencesSchema as schema } from "@ludo.ninja/api";
4
+ import { identitySchema } from "@ludo.ninja/api";
5
+ import { ProfileEntity } from "@ludo.ninja/core";
6
+ type TMyProfile = identitySchema.IFetchMyProfileV2Query["fetchMyProfileV2"];
7
7
  export interface IUserStore {
8
8
  user: IUser | null;
9
9
  setUser: (user: IUser | null) => void;
@@ -20,9 +20,11 @@ export interface IUserStore {
20
20
  profileData: ProfileEntity | null;
21
21
  setProfileData: (profileObject: TMyProfile | null) => void;
22
22
  profileObject: TMyProfile | null;
23
- updateProfileData: (profile: Pick<TMyProfile, 'showNsfw' | 'social' | 'about' | 'username' | 'userpic'>) => void;
23
+ updateProfileData: (profile: Pick<TMyProfile, "showNsfw" | "social" | "about" | "username" | "userpic">) => void;
24
24
  inviteCodes: identitySchema.IInviteCode[];
25
25
  setInviteCodes: (inviteCodes: identitySchema.IInviteCode[]) => void;
26
+ myShareLink: string;
27
+ setMyShareLink: (myShareLink: string) => void;
26
28
  }
27
29
  export declare const UserProvider: ({ children, initialState }: {
28
30
  children: import("react").ReactNode;
@@ -1,9 +1,9 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useUserStore = exports.UserProvider = void 0;
4
+ const core_1 = require("@ludo.ninja/core");
4
5
  const next_zustand_1 = require("next-zustand");
5
6
  const shallow_1 = require("zustand/shallow");
6
- const core_1 = require("@ludo.ninja/core");
7
7
  const initialUserExp = {
8
8
  xps: 0,
9
9
  level: 1,
@@ -68,6 +68,10 @@ const creators = (0, next_zustand_1.createProvider)()((setState) => ({
68
68
  setInviteCodes: (inviteCodes) => {
69
69
  setState({ inviteCodes });
70
70
  },
71
+ myShareLink: "",
72
+ setMyShareLink: (myShareLink) => {
73
+ setState({ myShareLink });
74
+ },
71
75
  }), shallow_1.shallow);
72
76
  exports.UserProvider = creators.Provider;
73
77
  exports.useUserStore = creators.getUseStore();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.2.27",
3
+ "version": "2.2.29",
4
4
  "private": false,
5
5
  "main": "build/index.js",
6
6
  "types": "build/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "publish": "npm publish --access public -workspace @ludo.ninja/components"
24
24
  },
25
25
  "dependencies": {
26
- "@ludo.ninja/api": "^3.0.20",
26
+ "@ludo.ninja/api": "^3.0.21",
27
27
  "@react-three/drei": "^9.68.3",
28
28
  "@react-three/fiber": "^8.13.0",
29
29
  "chart.js": "^4.4.3",
@@ -1,5 +0,0 @@
1
- import { EAssetVariants } from './types';
2
- import { IMedia } from '../media/types';
3
- export declare const getAssetMediaVariant: ({ media }: {
4
- media: IMedia;
5
- }) => EAssetVariants;