@ludo.ninja/components 2.2.44 → 2.2.45
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 ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
|
11
11
|
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
12
12
|
const store_1 = require("../../../modules/user/store");
|
|
13
13
|
const rc_tooltip_1 = __importDefault(require("rc-tooltip"));
|
|
14
|
+
require("rc-tooltip/assets/bootstrap_white.css");
|
|
14
15
|
const react_loading_skeleton_1 = __importDefault(require("react-loading-skeleton"));
|
|
15
16
|
const Wrapper = styled_components_1.default.div `
|
|
16
17
|
display: flex;
|
|
@@ -13,7 +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 header_1 = require("@ludo.ninja/ui/build/components/header");
|
|
16
|
-
const
|
|
16
|
+
const UserStreak_1 = __importDefault(require("../../base/UserStreak"));
|
|
17
17
|
// Component
|
|
18
18
|
const HeaderSearch = ({ showXP = true }) => {
|
|
19
19
|
const openSidebar = (0, ui_1.useUiStore)((state) => state.openSidebar);
|
|
@@ -28,7 +28,7 @@ const HeaderSearch = ({ showXP = true }) => {
|
|
|
28
28
|
}, slots: {
|
|
29
29
|
...(showXP ? {
|
|
30
30
|
headerExpLabel: (0, jsx_runtime_1.jsx)(headerExperienceLabel_1.default, { userId: getUser?.userId || "" }),
|
|
31
|
-
headerDaysStreak: (0, jsx_runtime_1.jsx)(
|
|
31
|
+
headerDaysStreak: (0, jsx_runtime_1.jsx)(UserStreak_1.default, {})
|
|
32
32
|
} : {}),
|
|
33
33
|
headerUserPick: (0, jsx_runtime_1.jsx)(headerUserPic_1.default, { userId: getUser?.userId || "" }),
|
|
34
34
|
logoLinkComponent: ({ children }) => ((0, jsx_runtime_1.jsx)("a", { href: ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE][isProd() ? "profile" : "app"], children: children })),
|
|
@@ -24,6 +24,13 @@ const StyledSidebarInviteCodeLabel = styled_components_1.default.div `
|
|
|
24
24
|
margin-top: ${(0, _4k_1.adaptiveValueCalc)(16)};
|
|
25
25
|
}
|
|
26
26
|
`;
|
|
27
|
+
const StyledUserStreak = (0, styled_components_1.default)(UserStreak_1.default) `
|
|
28
|
+
margin-top: 16px;
|
|
29
|
+
|
|
30
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
31
|
+
margin-top: ${(0, _4k_1.adaptiveValueCalc)(16)};
|
|
32
|
+
}
|
|
33
|
+
`;
|
|
27
34
|
// Component
|
|
28
35
|
const SidebarInviteCodeLabel = () => {
|
|
29
36
|
const { getUser, userExp, isLoadingExp, errorExp, isLoadingProfileData, inviteCodes, } = (0, store_1.useUserStore)((state) => ({
|
|
@@ -36,7 +43,7 @@ const SidebarInviteCodeLabel = () => {
|
|
|
36
43
|
}));
|
|
37
44
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
38
45
|
const unUsedInviteCodes = inviteCodes?.filter((code) => !code.isUsed);
|
|
39
|
-
return ((0, jsx_runtime_1.jsxs)(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 }))] }), (0, jsx_runtime_1.jsx)(
|
|
46
|
+
return ((0, jsx_runtime_1.jsxs)(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 }))] }), (0, jsx_runtime_1.jsx)(StyledUserStreak, {})] }));
|
|
40
47
|
};
|
|
41
48
|
// Export
|
|
42
49
|
exports.default = SidebarInviteCodeLabel;
|