@ludo.ninja/components 2.2.25 → 2.2.27
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/components/shareDialog/index.d.ts +1 -2
- package/build/components/shareDialog/index.js +2 -3
- package/build/modules/opportunity/OpportunityCard.js +6 -1
- package/build/modules/user/profileData/profileDataInitialization.js +4 -8
- package/build/modules/user/store.d.ts +6 -8
- package/build/modules/user/store.js +1 -5
- package/package.json +2 -2
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
interface IShareDialog {
|
|
2
|
-
shareMyProfileLink?: string;
|
|
3
2
|
link: string | null;
|
|
4
3
|
onHide: () => void;
|
|
5
4
|
params?: {
|
|
@@ -30,5 +29,5 @@ interface IShareDialog {
|
|
|
30
29
|
};
|
|
31
30
|
};
|
|
32
31
|
}
|
|
33
|
-
declare const ShareDialog: ({ link, onHide, params
|
|
32
|
+
declare const ShareDialog: ({ link, onHide, params }: IShareDialog) => import("react/jsx-runtime").JSX.Element;
|
|
34
33
|
export default ShareDialog;
|
|
@@ -18,7 +18,6 @@ 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
|
-
|
|
22
21
|
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
23
22
|
margin-bottom: ${(0, _4k_1.adaptiveValueCalc)(24)};
|
|
24
23
|
}
|
|
@@ -74,10 +73,10 @@ const StyledShare = styled_components_1.default.div `
|
|
|
74
73
|
}
|
|
75
74
|
}
|
|
76
75
|
`;
|
|
77
|
-
const ShareDialog = ({ link, onHide, params
|
|
76
|
+
const ShareDialog = ({ link, onHide, params }) => {
|
|
78
77
|
const url = new URL(link || "");
|
|
79
78
|
url.search = "";
|
|
80
|
-
const urlWithoutGetParameters =
|
|
79
|
+
const urlWithoutGetParameters = url.toString();
|
|
81
80
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
82
81
|
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: () => {
|
|
83
82
|
onHide();
|
|
@@ -31,6 +31,7 @@ const useDislikeOpportunity_1 = require("../../api/server-opportunities/mutation
|
|
|
31
31
|
const useLikeOpportunity_1 = require("../../api/server-opportunities/mutations/useLikeOpportunity");
|
|
32
32
|
const vars_1 = require("../../fonts/vars");
|
|
33
33
|
const heart_svg_1 = __importDefault(require("../../public/cards/heart"));
|
|
34
|
+
const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
|
|
34
35
|
const SWrapperLink = styled_components_1.default.a `
|
|
35
36
|
position: relative;
|
|
36
37
|
background-color: ${colors_1.WhiteColor};
|
|
@@ -226,6 +227,9 @@ const OpportunityLike = ({ isDefaultLiked, opportunityId, toolsForRemove, }) =>
|
|
|
226
227
|
}, children: (0, jsx_runtime_1.jsx)(heart_svg_1.default, {}) }));
|
|
227
228
|
};
|
|
228
229
|
const OpportunityCard = ({ opportunity, toolsForRemove, }) => {
|
|
230
|
+
const { NEXT_PUBLIC_ENV_VALUE } = (0, env_1.useEnvStore)((state) => ({
|
|
231
|
+
NEXT_PUBLIC_ENV_VALUE: state.NEXT_PUBLIC_ENV_VALUE,
|
|
232
|
+
}));
|
|
229
233
|
const { windowDimensions } = (0, screen_1.useWindowDimensionsWithServerInitial)();
|
|
230
234
|
const isMobile = !!(windowDimensions?.windowWidth &&
|
|
231
235
|
windowDimensions.windowWidth <= ScreenWidth_1.ScreenWidth.DESKTOP);
|
|
@@ -236,7 +240,8 @@ const OpportunityCard = ({ opportunity, toolsForRemove, }) => {
|
|
|
236
240
|
}));
|
|
237
241
|
const getMediaENVDomain = (0, env_1.useEnvStore)((state) => state.getMediaDomain);
|
|
238
242
|
const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
|
|
239
|
-
|
|
243
|
+
const opportunityLink = opportunity.opportunityType === 'TOKEN_AIRDROP' ? `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]['app']}/brand/${opportunity.opportunityId}` : (opportunity.shareLink || opportunity.projectUrl || "");
|
|
244
|
+
return ((0, jsx_runtime_1.jsxs)(SWrapperLink, { href: opportunityLink, target: "_blank", children: [(0, jsx_runtime_1.jsxs)(StyledCardHead, { children: [(0, jsx_runtime_1.jsx)(OpportunityImage, { alt: opportunity.name, src: opportunity.media
|
|
240
245
|
? `${getMediaENVDomain()}/opportunity-medias/${opportunity.media}`
|
|
241
246
|
: "" }), (0, jsx_runtime_1.jsx)(Headicons_1.default, { isMobile: isMobile, onClick: (e) => {
|
|
242
247
|
e.stopPropagation();
|
|
@@ -2,22 +2,21 @@
|
|
|
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");
|
|
7
5
|
const api_1 = require("@ludo.ninja/api");
|
|
8
6
|
const api_2 = require("@ludo.ninja/api");
|
|
9
7
|
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,
|
|
14
|
+
setUserExp, setInviteCodes, } = (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,
|
|
21
20
|
}));
|
|
22
21
|
// console.log('profileData', profileData);
|
|
23
22
|
api_2.identitySchema.useFetchMyProfileV2Query({
|
|
@@ -27,9 +26,7 @@ const FetcherMyProfile = ( /*{ userId }: { userId: string }*/) => {
|
|
|
27
26
|
onCompleted: ({ fetchMyProfileV2: fetchMyProfile }) => {
|
|
28
27
|
// console.log('fetchMyProfile', fetchMyProfile);
|
|
29
28
|
setProfileData(fetchMyProfile);
|
|
30
|
-
|
|
31
|
-
setMyShareLink(fetchMyProfile.shareLink);
|
|
32
|
-
}
|
|
29
|
+
setIsLoadingProfileData(false);
|
|
33
30
|
if (fetchMyProfile.xps) {
|
|
34
31
|
setUserExp({
|
|
35
32
|
levelMaxXps: fetchMyProfile.levelMaxXps,
|
|
@@ -41,7 +38,6 @@ const FetcherMyProfile = ( /*{ userId }: { userId: string }*/) => {
|
|
|
41
38
|
if (fetchMyProfile.inviteCodes) {
|
|
42
39
|
setInviteCodes(fetchMyProfile.inviteCodes);
|
|
43
40
|
}
|
|
44
|
-
setIsLoadingProfileData(false);
|
|
45
41
|
},
|
|
46
42
|
onError: (err) => {
|
|
47
43
|
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';
|
|
1
5
|
import { IUser } from '../../entities/user/type';
|
|
2
|
-
|
|
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"];
|
|
6
|
+
type TMyProfile = identitySchema.IFetchMyProfileV2Query['fetchMyProfileV2'];
|
|
7
7
|
export interface IUserStore {
|
|
8
8
|
user: IUser | null;
|
|
9
9
|
setUser: (user: IUser | null) => void;
|
|
@@ -20,11 +20,9 @@ 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,
|
|
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;
|
|
28
26
|
}
|
|
29
27
|
export declare const UserProvider: ({ children, initialState }: {
|
|
30
28
|
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");
|
|
5
4
|
const next_zustand_1 = require("next-zustand");
|
|
6
5
|
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,10 +68,6 @@ 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
|
-
},
|
|
75
71
|
}), shallow_1.shallow);
|
|
76
72
|
exports.UserProvider = creators.Provider;
|
|
77
73
|
exports.useUserStore = creators.getUseStore();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ludo.ninja/components",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.27",
|
|
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.
|
|
26
|
+
"@ludo.ninja/api": "^3.0.20",
|
|
27
27
|
"@react-three/drei": "^9.68.3",
|
|
28
28
|
"@react-three/fiber": "^8.13.0",
|
|
29
29
|
"chart.js": "^4.4.3",
|