@ludo.ninja/components 2.4.3 → 2.4.4
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.
|
@@ -108,18 +108,18 @@ const useSidebarData = () => {
|
|
|
108
108
|
icon: (0, jsx_runtime_1.jsx)(icons_1.RewardsIcon, {}),
|
|
109
109
|
isExternalUrl: false,
|
|
110
110
|
},
|
|
111
|
-
{
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
},
|
|
111
|
+
// {
|
|
112
|
+
// href: `${ludoDomains[NEXT_PUBLIC_ENV_VALUE as TEnvValue]["account"]}/referrals`,
|
|
113
|
+
// title: "Referral Dashboard",
|
|
114
|
+
// icon: <ReferralDashboardIcon />,
|
|
115
|
+
// isExternalUrl: false,
|
|
116
|
+
// },
|
|
117
|
+
// {
|
|
118
|
+
// href: `${ludoDomains[NEXT_PUBLIC_ENV_VALUE as TEnvValue]["app"]}/invite-codes`,
|
|
119
|
+
// title: "My invites",
|
|
120
|
+
// icon: <MyInvitesIcon />,
|
|
121
|
+
// isExternalUrl: false,
|
|
122
|
+
// },
|
|
123
123
|
]
|
|
124
124
|
: []),
|
|
125
125
|
];
|
|
@@ -7,8 +7,10 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const data_1 = require("./data");
|
|
8
8
|
const sidebarInviteCodeLabel_1 = __importDefault(require("./sidebarInviteCodeLabel"));
|
|
9
9
|
const useExtension_1 = __importDefault(require("../../hooks/extension/useExtension"));
|
|
10
|
+
const useRefCode_1 = require("../../hooks/refCode/useRefCode");
|
|
10
11
|
const useSignOut_1 = require("../../modules/user/auth/useSignOut");
|
|
11
12
|
const store_1 = require("../../modules/user/store");
|
|
13
|
+
const env_1 = require("../../store/env");
|
|
12
14
|
const ui_1 = require("../../store/ui");
|
|
13
15
|
const ScreenWidth_1 = require("../../styles/ScreenWidth");
|
|
14
16
|
const Userpic_1 = __importDefault(require("../../system/Img/Userpic"));
|
|
@@ -21,7 +23,6 @@ const MainButton_1 = __importDefault(require("@ludo.ninja/ui/build/system/Button
|
|
|
21
23
|
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
22
24
|
const link_1 = __importDefault(require("next/link"));
|
|
23
25
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
24
|
-
const useRefCode_1 = require("../../hooks/refCode/useRefCode");
|
|
25
26
|
const MenuItem = styled_components_1.default.div `
|
|
26
27
|
font-size: 15px;
|
|
27
28
|
font-weight: 500;
|
|
@@ -101,6 +102,7 @@ const Sidebar = () => {
|
|
|
101
102
|
const closeSidebar = (0, ui_1.useUiStore)((state) => state.closeSidebar);
|
|
102
103
|
const isSidebarOpen = (0, ui_1.useUiStore)((state) => state.isSidebarOpen);
|
|
103
104
|
const isAuthorized = (0, store_1.useUserStore)((state) => state.isSignedIn);
|
|
105
|
+
const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
|
|
104
106
|
const getUser = (0, store_1.useUserStore)((state) => state.user);
|
|
105
107
|
const signOut = (0, useSignOut_1.useSignOut)();
|
|
106
108
|
const { deviceType } = (0, screen_1.useWindowDimensions)();
|
|
@@ -121,7 +123,7 @@ const Sidebar = () => {
|
|
|
121
123
|
menu: sideBarData.map(({ title, href, icon, isExternalUrl }) => ((0, jsx_runtime_1.jsxs)(SLink, { href: href, target: isExternalUrl ? "_blank" : "_self", onClick: closeSidebar, passHref: isExternalUrl, scale: (0, scale_1.getAdaptiveScale)({ windowDimensions, currentSize: 1 }), children: [(0, jsx_runtime_1.jsx)("span", { className: "icon-wrapper", children: icon }), title] }, title))),
|
|
122
124
|
userPicture: ({ children, height, width, isNeedBoxTransform }) => ((0, jsx_runtime_1.jsx)(Userpic_1.default, { width: width, height: height, userId: userId, isNeedBoxTransform: isNeedBoxTransform, children: children })),
|
|
123
125
|
inviteCode: (0, jsx_runtime_1.jsx)(sidebarInviteCodeLabel_1.default, {}),
|
|
124
|
-
...(deviceType == "isDesktop" && isAuthorized
|
|
126
|
+
...(deviceType == "isDesktop" && isAuthorized && !isProd()
|
|
125
127
|
? {
|
|
126
128
|
beforeMenu: ((0, jsx_runtime_1.jsx)(BeforeMenuContainer, { children: isExtensionInstalled ? ((0, jsx_runtime_1.jsxs)(MenuItem, { onClick: () => {
|
|
127
129
|
closeSidebar();
|
|
@@ -4,14 +4,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
-
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
-
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
9
7
|
const store_1 = require("../../../modules/user/store");
|
|
8
|
+
const env_1 = require("../../../store/env");
|
|
10
9
|
const ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
11
10
|
const ExperienceLabel_1 = __importDefault(require("../../../system/Labels/ExperienceLabel"));
|
|
12
11
|
const InviteLabel_1 = __importDefault(require("../../../system/Labels/InviteLabel"));
|
|
13
|
-
const env_1 = require("../../../store/env");
|
|
14
12
|
const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
|
|
13
|
+
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
14
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
15
15
|
// import UserStreak from "@/components/base/UserStreak";
|
|
16
16
|
// Styles
|
|
17
17
|
const StyledSidebarInviteCodeLabel = styled_components_1.default.div `
|
|
@@ -33,7 +33,7 @@ const StyledSidebarInviteCodeLabel = styled_components_1.default.div `
|
|
|
33
33
|
// `;
|
|
34
34
|
// Component
|
|
35
35
|
const SidebarInviteCodeLabel = () => {
|
|
36
|
-
const { getUser, userExp, isLoadingExp, errorExp, isLoadingProfileData, inviteCodes
|
|
36
|
+
const { getUser, userExp, isLoadingExp, errorExp, isLoadingProfileData, inviteCodes } = (0, store_1.useUserStore)((state) => ({
|
|
37
37
|
getUser: state.user,
|
|
38
38
|
userExp: state.userExp,
|
|
39
39
|
isLoadingExp: state.isLoadingExp,
|
|
@@ -42,8 +42,9 @@ const SidebarInviteCodeLabel = () => {
|
|
|
42
42
|
inviteCodes: state.inviteCodes,
|
|
43
43
|
}));
|
|
44
44
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
45
|
+
const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
|
|
45
46
|
const unUsedInviteCodes = inviteCodes?.filter((code) => !code.isUsed);
|
|
46
|
-
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(StyledSidebarInviteCodeLabel, { children: [(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 }), !!unUsedInviteCodes && ((0, jsx_runtime_1.jsx)(InviteLabel_1.default, { value: unUsedInviteCodes.length, link: `${ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["app"]}/invite-codes`, loading: isLoadingProfileData }))] }) }));
|
|
47
|
+
return ((0, jsx_runtime_1.jsx)(jsx_runtime_1.Fragment, { children: (0, jsx_runtime_1.jsxs)(StyledSidebarInviteCodeLabel, { children: [(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 }), !!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 }))] }) }));
|
|
47
48
|
};
|
|
48
49
|
// Export
|
|
49
50
|
exports.default = SidebarInviteCodeLabel;
|
|
@@ -19,6 +19,7 @@ const sidebar_1 = require("@ludo.ninja/ui/build/components/sidebar");
|
|
|
19
19
|
const MainButton_1 = __importDefault(require("@ludo.ninja/ui/build/system/Buttons/MainButton"));
|
|
20
20
|
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
21
21
|
const styled_components_1 = __importDefault(require("styled-components"));
|
|
22
|
+
const env_1 = require("../../store/env");
|
|
22
23
|
const MenuItem = styled_components_1.default.div `
|
|
23
24
|
font-size: 15px;
|
|
24
25
|
font-weight: 500;
|
|
@@ -98,6 +99,7 @@ const SidebarSpa = ({ SLink, UserPic, SidebarInviteCodeLabel, }) => {
|
|
|
98
99
|
const closeSidebar = (0, ui_1.useUiStore)((state) => state.closeSidebar);
|
|
99
100
|
const isSidebarOpen = (0, ui_1.useUiStore)((state) => state.isSidebarOpen);
|
|
100
101
|
const isAuthorized = (0, store_1.useUserStore)((state) => state.isSignedIn);
|
|
102
|
+
const isProd = (0, env_1.useEnvStore)((state) => state.isProd);
|
|
101
103
|
const getUser = (0, store_1.useUserStore)((state) => state.user);
|
|
102
104
|
const signOut = (0, useSignOut_1.useSignOut)();
|
|
103
105
|
const { deviceType } = (0, screen_1.useWindowDimensions)();
|
|
@@ -118,7 +120,7 @@ const SidebarSpa = ({ SLink, UserPic, SidebarInviteCodeLabel, }) => {
|
|
|
118
120
|
menu: sideBarData.map(({ title, href, icon, isExternalUrl }) => ((0, jsx_runtime_1.jsxs)(SLink, { href: href, target: isExternalUrl ? "_blank" : "_self", onClick: closeSidebar, passHref: isExternalUrl, scale: (0, scale_1.getAdaptiveScale)({ windowDimensions, currentSize: 1 }), children: [(0, jsx_runtime_1.jsx)("span", { className: "icon-wrapper", children: icon }), title] }, title))),
|
|
119
121
|
userPicture: ({ children, height, width, isNeedBoxTransform }) => ((0, jsx_runtime_1.jsx)(UserPic, { width: width, height: height, userId: userId, isNeedBoxTransform: isNeedBoxTransform, children: children })),
|
|
120
122
|
inviteCode: (0, jsx_runtime_1.jsx)(SidebarInviteCodeLabel, {}),
|
|
121
|
-
...(deviceType == "isDesktop" && isAuthorized
|
|
123
|
+
...(deviceType == "isDesktop" && isAuthorized && !isProd()
|
|
122
124
|
? {
|
|
123
125
|
beforeMenu: ((0, jsx_runtime_1.jsx)(BeforeMenuContainer, { children: isExtensionInstalled ? ((0, jsx_runtime_1.jsxs)(MenuItem, { onClick: () => {
|
|
124
126
|
closeSidebar();
|