@ludo.ninja/components 2.4.44 → 2.4.46
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/subscriptions/SubscriptionNotificationSPA.js +12 -10
- package/build/components/headers/components/headerExperienceLabel/index.js +1 -1
- package/build/components/sidebar/sidebarInviteCodeLabel/index.js +4 -4
- package/build/system/Forms/Input/index.d.ts +1 -0
- package/build/system/Forms/Input/index.js +2 -2
- package/package.json +2 -1
|
@@ -11,6 +11,7 @@ const env_1 = require("../../store/env");
|
|
|
11
11
|
const ui_1 = require("../../store/ui");
|
|
12
12
|
const client_1 = require("@apollo/client");
|
|
13
13
|
const api_1 = require("@ludo.ninja/api");
|
|
14
|
+
const api_server_notifications_1 = require("@ludo_dev/api-server-notifications");
|
|
14
15
|
const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
|
|
15
16
|
const InviteCodeSvg_1 = require("@ludo.ninja/ui/build/modules/notifications/variants/InviteCodeSvg");
|
|
16
17
|
const OpportunitySvg_1 = require("@ludo.ninja/ui/build/modules/notifications/variants/OpportunitySvg");
|
|
@@ -73,20 +74,20 @@ const Subscription = ({ routerPush }) => {
|
|
|
73
74
|
user: state.user,
|
|
74
75
|
}));
|
|
75
76
|
const userId = user?.userId || "";
|
|
76
|
-
const [readNotification] =
|
|
77
|
+
const [readNotification] = (0, api_server_notifications_1.useReadNotificationMutation)({
|
|
77
78
|
context: {
|
|
78
|
-
uri:
|
|
79
|
+
uri: api_server_notifications_1.host,
|
|
79
80
|
},
|
|
80
81
|
});
|
|
81
|
-
(0, client_1.useSubscription)(
|
|
82
|
-
variables: { authToken, notificationTypes: [
|
|
82
|
+
(0, client_1.useSubscription)(api_server_notifications_1.OnNotificationDocument, {
|
|
83
|
+
variables: { authToken, notificationTypes: [api_server_notifications_1.INotificationType.Push] },
|
|
83
84
|
onData: (options) => {
|
|
84
85
|
const notification = options.data.data?.onNotification;
|
|
85
86
|
// console.log("notification", notification);
|
|
86
87
|
if (notification) {
|
|
87
88
|
switch (notification.eventType) {
|
|
88
|
-
case
|
|
89
|
-
case
|
|
89
|
+
case api_server_notifications_1.IEventType.CommonOpportunity:
|
|
90
|
+
case api_server_notifications_1.IEventType.UserOpportunity:
|
|
90
91
|
addNotification({
|
|
91
92
|
icon: ((0, jsx_runtime_1.jsx)(ImageNotification, { src: notification.media || "", title: notification.name || "Opportunity updated", fallbackSvg: (0, jsx_runtime_1.jsx)(OpportunitySvg_1.OpportunitySvg, {}) })),
|
|
92
93
|
title: notification.name || "Opportunity updated",
|
|
@@ -98,7 +99,8 @@ const Subscription = ({ routerPush }) => {
|
|
|
98
99
|
},
|
|
99
100
|
});
|
|
100
101
|
break;
|
|
101
|
-
case
|
|
102
|
+
case api_server_notifications_1.IEventType.ProjectAlert:
|
|
103
|
+
case api_server_notifications_1.IEventType.ProjectFeatureUpdate:
|
|
102
104
|
addNotification({
|
|
103
105
|
icon: ((0, jsx_runtime_1.jsx)(ImageNotification, { src: "", title: notification.name || "Project alert", fallbackSvg: (0, jsx_runtime_1.jsx)(ProjectSvg_1.ProjectSvg, {}) })),
|
|
104
106
|
title: notification.name || "Project alert",
|
|
@@ -110,7 +112,7 @@ const Subscription = ({ routerPush }) => {
|
|
|
110
112
|
},
|
|
111
113
|
});
|
|
112
114
|
break;
|
|
113
|
-
case
|
|
115
|
+
case api_server_notifications_1.IEventType.UserInvitee:
|
|
114
116
|
addNotification({
|
|
115
117
|
icon: ((0, jsx_runtime_1.jsx)(ImageNotification, { src: notification.media || "", title: notification.name || "Invite code used", fallbackSvg: (0, jsx_runtime_1.jsx)(InviteCodeSvg_1.InviteCodeSvg, {}) })),
|
|
116
118
|
title: notification.name || "Invite code used",
|
|
@@ -126,8 +128,8 @@ const Subscription = ({ routerPush }) => {
|
|
|
126
128
|
},
|
|
127
129
|
});
|
|
128
130
|
break;
|
|
129
|
-
case
|
|
130
|
-
case
|
|
131
|
+
case api_server_notifications_1.IEventType.UserXpIncrement:
|
|
132
|
+
case api_server_notifications_1.IEventType.UserXps:
|
|
131
133
|
addNotification({
|
|
132
134
|
icon: ((0, jsx_runtime_1.jsx)(ImageNotification, { src: notification.media || "", title: notification.name || "XP updated", fallbackSvg: (0, jsx_runtime_1.jsx)(XPIconSvg_1.XpIconSvg, {}) })),
|
|
133
135
|
title: notification.name || "XP updated",
|
|
@@ -30,7 +30,7 @@ const HeaderExperienceLabel = ({ userId }) => {
|
|
|
30
30
|
}));
|
|
31
31
|
if (!userId)
|
|
32
32
|
return null;
|
|
33
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(StyledHeaderExperienceLabel, { children: (0, jsx_runtime_1.jsx)(CreditsLabel_1.default, { value: userCredits, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/
|
|
33
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(StyledHeaderExperienceLabel, { children: (0, jsx_runtime_1.jsx)(CreditsLabel_1.default, { value: userCredits, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/credits`, loading: isLoadingExp || !!errorExp }) }), (0, jsx_runtime_1.jsx)(StyledHeaderExperienceLabel, { children: (0, jsx_runtime_1.jsx)(ExperienceLabel_1.default, { value: userExp.xps, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/rewards/${userId}`, loading: isLoadingExp || !!errorExp }) })] }));
|
|
34
34
|
};
|
|
35
35
|
// Export
|
|
36
36
|
exports.default = HeaderExperienceLabel;
|
|
@@ -32,7 +32,7 @@ const store_1 = require("../../../modules/user/store");
|
|
|
32
32
|
const env_1 = require("../../../store/env");
|
|
33
33
|
const ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
34
34
|
const ExperienceLabel_1 = __importDefault(require("../../../system/Labels/ExperienceLabel"));
|
|
35
|
-
|
|
35
|
+
// import InviteLabel from "@/system/Labels/InviteLabel";
|
|
36
36
|
const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
|
|
37
37
|
const typography_1 = require("@ludo.ninja/ui/build/styles/typography");
|
|
38
38
|
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
@@ -78,10 +78,10 @@ const SidebarInviteCodeLabel = () => {
|
|
|
78
78
|
inviteCodes: state.inviteCodes,
|
|
79
79
|
}));
|
|
80
80
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
81
|
-
const isProd =
|
|
82
|
-
const unUsedInviteCodes = inviteCodes?.filter((code) => !code.isUsed);
|
|
81
|
+
// const isProd = useEnvStore((state) => state.isProd);
|
|
82
|
+
// const unUsedInviteCodes = inviteCodes?.filter((code) => !code.isUsed);
|
|
83
83
|
const profileData = (0, store_1.useUserStore)((state) => state.profileData);
|
|
84
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(StyledSidebarInviteCodeLabel, { children: [(0, jsx_runtime_1.jsx)(SidebarBoostBadge, { boostType: profileData?.getBoost(), previousBoostType: profileData?.getPreviousBoost(), backgroundColor: '#ffffff' }), (0, jsx_runtime_1.jsx)(ExperienceLabel_1.default, { value: userExp.xps, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/rewards/${getUser?.userId}`, loading: isLoadingExp || !!errorExp }), (0, jsx_runtime_1.jsx)(CreditsLabel_1.default, { value: userCredits, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/
|
|
84
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(StyledSidebarInviteCodeLabel, { children: [(0, jsx_runtime_1.jsx)(SidebarBoostBadge, { boostType: profileData?.getBoost(), previousBoostType: profileData?.getPreviousBoost(), backgroundColor: '#ffffff' }), (0, jsx_runtime_1.jsx)(ExperienceLabel_1.default, { value: userExp.xps, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/rewards/${getUser?.userId}`, loading: isLoadingExp || !!errorExp }), (0, jsx_runtime_1.jsx)(CreditsLabel_1.default, { value: userCredits, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/credits`, loading: isLoadingExp || !!errorExp })] }) }));
|
|
85
85
|
};
|
|
86
86
|
// Export
|
|
87
87
|
exports.default = SidebarInviteCodeLabel;
|
|
@@ -52,12 +52,12 @@ exports.StyledInput = styled_components_1.default.input `
|
|
|
52
52
|
padding: ${(0, _4k_1.adaptiveValueCalc)(12)};
|
|
53
53
|
}
|
|
54
54
|
`;
|
|
55
|
-
const Input = ({ data, register, error, disabled }) => {
|
|
55
|
+
const Input = ({ data, type, register, error, disabled }) => {
|
|
56
56
|
const renderError = () => {
|
|
57
57
|
if (error.isNeedShowError) {
|
|
58
58
|
return (0, jsx_runtime_1.jsx)(ErrorLabel_1.default, { children: error.message });
|
|
59
59
|
}
|
|
60
60
|
};
|
|
61
|
-
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(exports.StyledInput, { ref: register.ref, onChange: register.onChange, onBlur: register.onBlur, name: register.name, id: data.name, autoComplete: "off", placeholder: data.placeHolder, status: error.isNeedShowError, disabled: disabled }), renderError()] }));
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(exports.StyledInput, { ref: register.ref, onChange: register.onChange, onBlur: register.onBlur, name: register.name, id: data.name, autoComplete: "off", placeholder: data.placeHolder, status: error.isNeedShowError, disabled: disabled, type: type }), renderError()] }));
|
|
62
62
|
};
|
|
63
63
|
exports.default = Input;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ludo.ninja/components",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.46",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"publish": "npm publish --access public -workspace @ludo.ninja/components"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
+
"@ludo_dev/api-server-notifications": "1.0.0-development-8de201c-ihnatov.d-2026-01-19-15-51-07",
|
|
26
27
|
"@ludo.ninja/api": "^3.2.60",
|
|
27
28
|
"@marker.io/browser": "^0.19.0",
|
|
28
29
|
"@next/third-parties": "^15.3.4",
|