@ludo.ninja/components 2.2.47 → 2.2.49
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.
|
@@ -13,6 +13,7 @@ const ui_1 = require("../../../store/ui");
|
|
|
13
13
|
const auth_1 = require("../../../utils/auth");
|
|
14
14
|
const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
|
|
15
15
|
const env_1 = require("../../../store/env");
|
|
16
|
+
const headerStreak_1 = __importDefault(require("../components/headerStreak"));
|
|
16
17
|
// Component
|
|
17
18
|
const Header = () => {
|
|
18
19
|
const isSignedIn = (0, store_1.useUserStore)((state) => state.isSignedIn);
|
|
@@ -26,6 +27,7 @@ const Header = () => {
|
|
|
26
27
|
openSidebar,
|
|
27
28
|
}, slots: {
|
|
28
29
|
headerExpLabel: ((0, jsx_runtime_1.jsx)(headerExperienceLabel_1.default, { userId: getUser?.userId || "" })),
|
|
30
|
+
headerDaysStreak: (0, jsx_runtime_1.jsx)(headerStreak_1.default, { tooltipPosition: 'bottom' }),
|
|
29
31
|
headerUserPick: (0, jsx_runtime_1.jsx)(headerUserPic_1.default, { userId: getUser?.userId || "" }),
|
|
30
32
|
logoLinkComponent: ({ children }) => (0, jsx_runtime_1.jsx)(link_1.default, { href: ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE][isProd() ? "profile" : "app"], children: children }),
|
|
31
33
|
} }));
|
|
@@ -71,9 +71,11 @@ const StyledSearchSuggestions = styled_components_1.default.div `
|
|
|
71
71
|
`;
|
|
72
72
|
// Components
|
|
73
73
|
const SearchSuggestions = ({ searchTerm, assets, profiles, collections, isLoading }) => {
|
|
74
|
-
const { getMediaENVDomain, NEXT_PUBLIC_ENV_VALUE } = (0, env_1.useEnvStore)((state) => ({
|
|
74
|
+
const { getMediaENVDomain, NEXT_PUBLIC_ENV_VALUE, getAudioDomain, getVideoDomain } = (0, env_1.useEnvStore)((state) => ({
|
|
75
75
|
getMediaENVDomain: state.getMediaDomain,
|
|
76
76
|
NEXT_PUBLIC_ENV_VALUE: state.NEXT_PUBLIC_ENV_VALUE,
|
|
77
|
+
getAudioDomain: state.getAudioDomain,
|
|
78
|
+
getVideoDomain: state.getVideoDomain,
|
|
77
79
|
}));
|
|
78
80
|
const isNotFound = !assets?.length && !profiles?.length && !collections?.length;
|
|
79
81
|
return ((0, jsx_runtime_1.jsx)(StyledSearchSuggestions, { children: (0, jsx_runtime_1.jsxs)("div", { className: "content", children: [isLoading && (0, jsx_runtime_1.jsx)(searchSuggestionsItemSkeleton_1.SearchSuggestionsItemsSkeleton, {}), !isLoading &&
|
|
@@ -82,7 +84,7 @@ const SearchSuggestions = ({ searchTerm, assets, profiles, collections, isLoadin
|
|
|
82
84
|
? [
|
|
83
85
|
{
|
|
84
86
|
caption: "NFTs",
|
|
85
|
-
children: assets.map((asset) => ((0, jsx_runtime_1.jsx)(searchSuggestionsItem_1.default, { name: asset?.name, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["asset"]}${asset.assetLink.replace(`${types_1.LabelKeys.asset}/`, "")}`, imgUrl: (0, getAssetMiniatureUrl_1.getAssetMiniatureUrl)({ asset }), searchTerm: searchTerm }, `${asset?.assetId}.${Math.random()}`))),
|
|
87
|
+
children: assets.map((asset) => ((0, jsx_runtime_1.jsx)(searchSuggestionsItem_1.default, { name: asset?.name, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["asset"]}${asset.assetLink.replace(`${types_1.LabelKeys.asset}/`, "")}`, imgUrl: (0, getAssetMiniatureUrl_1.getAssetMiniatureUrl)({ asset, nextPublicDomain: NEXT_PUBLIC_ENV_VALUE, getAudioDomain, getVideoDomain }), searchTerm: searchTerm }, `${asset?.assetId}.${Math.random()}`))),
|
|
86
88
|
},
|
|
87
89
|
]
|
|
88
90
|
: []),
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import { TAsset } from './types';
|
|
2
|
-
export declare const getAssetMiniatureUrl: ({ asset }: {
|
|
2
|
+
export declare const getAssetMiniatureUrl: ({ asset, nextPublicDomain, getAudioDomain, getVideoDomain }: {
|
|
3
3
|
asset: TAsset;
|
|
4
|
+
nextPublicDomain: string;
|
|
5
|
+
getAudioDomain: (env?: string) => string;
|
|
6
|
+
getVideoDomain: (env?: string) => string;
|
|
4
7
|
}) => string;
|
|
@@ -4,14 +4,8 @@ exports.getAssetMiniatureUrl = void 0;
|
|
|
4
4
|
const getMediaVariant_1 = require("../media/getMediaVariant");
|
|
5
5
|
const types_1 = require("../media/types");
|
|
6
6
|
const urls_1 = require("../media/urls");
|
|
7
|
-
const env_1 = require("../../store/env");
|
|
8
7
|
const constants_1 = require("@ludo.ninja/core/build/constants");
|
|
9
|
-
const getAssetMiniatureUrl = ({ asset }) => {
|
|
10
|
-
const { NEXT_PUBLIC_STATIC_DOMAIN, getAudioDomain, getVideoDomain } = (0, env_1.useEnvStore)((state) => ({
|
|
11
|
-
NEXT_PUBLIC_STATIC_DOMAIN: state.NEXT_PUBLIC_STATIC_DOMAIN,
|
|
12
|
-
getAudioDomain: state.getAudioDomain,
|
|
13
|
-
getVideoDomain: state.getVideoDomain,
|
|
14
|
-
}));
|
|
8
|
+
const getAssetMiniatureUrl = ({ asset, nextPublicDomain, getAudioDomain, getVideoDomain }) => {
|
|
15
9
|
const media = asset.medias[0];
|
|
16
10
|
if (!media)
|
|
17
11
|
return `${constants_1.staticLink}/public/noContent/noContent.svg`;
|
|
@@ -31,7 +25,7 @@ const getAssetMiniatureUrl = ({ asset }) => {
|
|
|
31
25
|
case types_1.EMediaVariants.other:
|
|
32
26
|
case types_1.EMediaVariants.screenshot:
|
|
33
27
|
default:
|
|
34
|
-
return (0, urls_1.isExternalMediaImage)(media.media, urls_1.mediaSizes.small,
|
|
28
|
+
return (0, urls_1.isExternalMediaImage)(media.media, urls_1.mediaSizes.small, nextPublicDomain);
|
|
35
29
|
}
|
|
36
30
|
};
|
|
37
31
|
exports.getAssetMiniatureUrl = getAssetMiniatureUrl;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ludo.ninja/components",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.49",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"build"
|
|
9
9
|
],
|
|
10
10
|
"scripts": {
|
|
11
|
-
"dev": "next dev -p
|
|
11
|
+
"dev": "next dev -p 3022",
|
|
12
12
|
"clean": "rimraf tsconfig.tsbuildinfo && rimraf tsconfig.build.tsbuildinfo && rimraf build",
|
|
13
13
|
"build:tsc": "npm run clean && tsc --build tsconfig.build.json",
|
|
14
14
|
"replaceImports": "node scripts/replaceImports.js",
|