@ludo.ninja/components 2.2.41 → 2.2.43
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/base/UserStreak/index.d.ts +6 -1
- package/build/components/base/UserStreak/index.js +27 -6
- package/build/components/headers/components/headerStreak/index.d.ts +5 -0
- package/build/components/headers/components/headerStreak/index.js +21 -0
- package/build/components/headers/headerSearch/index.js +5 -1
- package/build/components/sidebar/sidebarInviteCodeLabel/index.js +2 -1
- package/build/modules/user/profileData/profileDataInitialization.js +5 -0
- package/package.json +1 -1
|
@@ -45,10 +45,6 @@ const Wrapper = styled_components_1.default.div `
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
.testRoot {
|
|
49
|
-
background-color: red;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
48
|
.skeleton-streak {
|
|
53
49
|
border-radius: 16px;
|
|
54
50
|
height: 16px;
|
|
@@ -68,9 +64,7 @@ const Wrapper = styled_components_1.default.div `
|
|
|
68
64
|
const StreakInfo = styled_components_1.default.div `
|
|
69
65
|
display: flex;
|
|
70
66
|
width: 356px;
|
|
71
|
-
//height: 100px;
|
|
72
67
|
flex-direction: column;
|
|
73
|
-
//justify-content: center;
|
|
74
68
|
align-items: flex-start;
|
|
75
69
|
gap: 6px;
|
|
76
70
|
flex-shrink: 0;
|
|
@@ -95,6 +89,10 @@ const StreakInfo = styled_components_1.default.div `
|
|
|
95
89
|
font-style: normal;
|
|
96
90
|
font-weight: 400;
|
|
97
91
|
line-height: 18px;
|
|
92
|
+
|
|
93
|
+
li:not(:last-child) {
|
|
94
|
+
margin-bottom: 13px;
|
|
95
|
+
}
|
|
98
96
|
}
|
|
99
97
|
|
|
100
98
|
ul {
|
|
@@ -107,6 +105,28 @@ const StreakInfo = styled_components_1.default.div `
|
|
|
107
105
|
margin-right: 4px;
|
|
108
106
|
font-weight: 700;
|
|
109
107
|
}
|
|
108
|
+
|
|
109
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
110
|
+
width: ${(0, _4k_1.adaptiveValueCalc)(356)};
|
|
111
|
+
gap: ${(0, _4k_1.adaptiveValueCalc)(6)};
|
|
112
|
+
|
|
113
|
+
.title {
|
|
114
|
+
font-size: ${(0, _4k_1.adaptiveValueCalc)(15)};
|
|
115
|
+
line-height: ${(0, _4k_1.adaptiveValueCalc)(22)};
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.description {
|
|
119
|
+
font-size: ${(0, _4k_1.adaptiveValueCalc)(13)};
|
|
120
|
+
line-height: ${(0, _4k_1.adaptiveValueCalc)(18)};
|
|
121
|
+
|
|
122
|
+
li:not(:last-child) {
|
|
123
|
+
margin-bottom: ${(0, _4k_1.adaptiveValueCalc)(13)};
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
span {
|
|
127
|
+
margin-right: ${(0, _4k_1.adaptiveValueCalc)(4)};
|
|
128
|
+
}
|
|
129
|
+
}
|
|
110
130
|
`;
|
|
111
131
|
const CheckSVGIcon = () => {
|
|
112
132
|
return ((0, jsx_runtime_1.jsx)("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 12 12", fill: "none", children: (0, jsx_runtime_1.jsx)("path", { fillRule: "evenodd", clipRule: "evenodd", d: "M1.76335 5.23043C2.11482 4.87895 2.68467 4.87895 3.03614 5.23043L5.36959 7.56388L9.4001 3.53337C9.75158 3.1819 10.3214 3.1819 10.6729 3.53337C11.0244 3.88484 11.0244 4.45469 10.6729 4.80616L6.00599 9.47307C5.65452 9.82454 5.08467 9.82454 4.7332 9.47307L1.76335 6.50322C1.41188 6.15175 1.41188 5.5819 1.76335 5.23043Z", fill: "#B0B2C0" }) }));
|
|
@@ -138,3 +158,4 @@ const UserStreak = ({ className, style }) => {
|
|
|
138
158
|
alignItems: 'center',
|
|
139
159
|
}, children: (0, jsx_runtime_1.jsx)(TooltipSVGIcon, {}) }) })] })) })] }));
|
|
140
160
|
};
|
|
161
|
+
exports.default = UserStreak;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const HeaderStreak: import("styled-components").StyledComponent<({ className, style }: {
|
|
2
|
+
className?: string;
|
|
3
|
+
style?: React.CSSProperties;
|
|
4
|
+
}) => import("react/jsx-runtime").JSX.Element, import("styled-components").DefaultTheme, {}, never>;
|
|
5
|
+
export default HeaderStreak;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
7
|
+
const UserStreak_1 = __importDefault(require("../../../base/UserStreak"));
|
|
8
|
+
const ScreenWidth_1 = require("../../../../styles/ScreenWidth");
|
|
9
|
+
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
10
|
+
const HeaderStreak = (0, styled_components_1.default)(UserStreak_1.default) `
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: 2px;
|
|
13
|
+
align-items: end;
|
|
14
|
+
margin-right: 20px;
|
|
15
|
+
|
|
16
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
17
|
+
gap: ${(0, _4k_1.adaptiveValueCalc)(2)};
|
|
18
|
+
margin-right: ${(0, _4k_1.adaptiveValueCalc)(20)};
|
|
19
|
+
}
|
|
20
|
+
`;
|
|
21
|
+
exports.default = HeaderStreak;
|
|
@@ -13,6 +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 headerStreak_1 = __importDefault(require("../components/headerStreak"));
|
|
16
17
|
// Component
|
|
17
18
|
const HeaderSearch = ({ showXP = true }) => {
|
|
18
19
|
const openSidebar = (0, ui_1.useUiStore)((state) => state.openSidebar);
|
|
@@ -25,7 +26,10 @@ const HeaderSearch = ({ showXP = true }) => {
|
|
|
25
26
|
login: redirectToLoginWindow,
|
|
26
27
|
openSidebar,
|
|
27
28
|
}, slots: {
|
|
28
|
-
...(showXP ? {
|
|
29
|
+
...(showXP ? {
|
|
30
|
+
headerExpLabel: (0, jsx_runtime_1.jsx)(headerExperienceLabel_1.default, { userId: getUser?.userId || "" }),
|
|
31
|
+
headerUserPick: (0, jsx_runtime_1.jsx)(headerStreak_1.default, {})
|
|
32
|
+
} : {}),
|
|
29
33
|
headerUserPick: (0, jsx_runtime_1.jsx)(headerUserPic_1.default, { userId: getUser?.userId || "" }),
|
|
30
34
|
logoLinkComponent: ({ children }) => ((0, jsx_runtime_1.jsx)("a", { href: ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE][isProd() ? "profile" : "app"], children: children })),
|
|
31
35
|
searchInput: ({ setInputFocused }) => {
|
|
@@ -12,6 +12,7 @@ const ExperienceLabel_1 = __importDefault(require("../../../system/Labels/Experi
|
|
|
12
12
|
const InviteLabel_1 = __importDefault(require("../../../system/Labels/InviteLabel"));
|
|
13
13
|
const env_1 = require("../../../store/env");
|
|
14
14
|
const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
|
|
15
|
+
const UserStreak_1 = __importDefault(require("../../base/UserStreak"));
|
|
15
16
|
// Styles
|
|
16
17
|
const StyledSidebarInviteCodeLabel = styled_components_1.default.div `
|
|
17
18
|
display: flex;
|
|
@@ -35,7 +36,7 @@ const SidebarInviteCodeLabel = () => {
|
|
|
35
36
|
}));
|
|
36
37
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
37
38
|
const unUsedInviteCodes = inviteCodes?.filter((code) => !code.isUsed);
|
|
38
|
-
return ((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 }))] }));
|
|
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)(UserStreak_1.default, {})] }));
|
|
39
40
|
};
|
|
40
41
|
// Export
|
|
41
42
|
exports.default = SidebarInviteCodeLabel;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
2
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
6
|
exports.ProfileDataInitialization = void 0;
|
|
4
7
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
@@ -7,6 +10,7 @@ const ui_1 = require("../../../store/ui");
|
|
|
7
10
|
const api_1 = require("@ludo.ninja/api");
|
|
8
11
|
const api_2 = require("@ludo.ninja/api");
|
|
9
12
|
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
13
|
+
const useFetchMyActivityStreak_1 = __importDefault(require("../../../api/server-experiences/queries/useFetchMyActivityStreak"));
|
|
10
14
|
const FetcherMyProfile = ( /*{ userId }: { userId: string }*/) => {
|
|
11
15
|
const openAlert = (0, ui_1.useUiStore)((state) => state.openAlert);
|
|
12
16
|
const { setIsLoadingProfileData, setProfileData,
|
|
@@ -53,6 +57,7 @@ const FetcherMyProfile = ( /*{ userId }: { userId: string }*/) => {
|
|
|
53
57
|
setIsLoadingProfileData(false);
|
|
54
58
|
},
|
|
55
59
|
});
|
|
60
|
+
(0, useFetchMyActivityStreak_1.default)();
|
|
56
61
|
return null;
|
|
57
62
|
};
|
|
58
63
|
const ProfileDataInitialization = () => {
|