@ludo.ninja/components 2.4.45 → 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.
@@ -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] = api_1.notificationsSchema.useReadNotificationMutation({
77
+ const [readNotification] = (0, api_server_notifications_1.useReadNotificationMutation)({
77
78
  context: {
78
- uri: api_1.hosts.notificationsHost,
79
+ uri: api_server_notifications_1.host,
79
80
  },
80
81
  });
81
- (0, client_1.useSubscription)(api_1.notificationsSchema.OnNotificationDocument, {
82
- variables: { authToken, notificationTypes: [api_1.notificationsSchema.INotificationType.Push] },
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 api_1.notificationsSchema.IEventType.CommonOpportunity:
89
- case api_1.notificationsSchema.IEventType.UserOpportunity:
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 api_1.notificationsSchema.IEventType.ProjectAlert:
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 api_1.notificationsSchema.IEventType.UserInvitee:
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 api_1.notificationsSchema.IEventType.UserXpIncrement:
130
- case api_1.notificationsSchema.IEventType.UserXps:
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"]}/rewards/${userId}`, 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 }) })] }));
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
- const InviteLabel_1 = __importDefault(require("../../../system/Labels/InviteLabel"));
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 = (0, env_1.useEnvStore)((state) => state.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"]}/rewards/${getUser?.userId}`, loading: isLoadingExp || !!errorExp }), !!unUsedInviteCodes && !isProd() && ((0, jsx_runtime_1.jsx)(InviteLabel_1.default, { value: unUsedInviteCodes.length, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/invite-codes`, loading: isLoadingProfileData }))] }) }));
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ludo.ninja/components",
3
- "version": "2.4.45",
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",