@ludo.ninja/components 2.2.39 → 2.2.41
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/server-experiences/queries/useFetchMyActivityStreak/index.d.ts +2 -0
- package/build/api/server-experiences/queries/useFetchMyActivityStreak/index.js +53 -0
- package/build/components/base/UserStreak/index.d.ts +1 -0
- package/build/components/base/UserStreak/index.js +140 -0
- package/build/components/search/SearchInputContainer.d.ts +1 -1
- package/build/components/search/SearchInputContainer.js +17 -14
- package/build/components/search/searchSuggestions/index.js +1 -1
- package/build/layouts/GlobalLayout.js +1 -0
- package/build/modules/user/store.d.ts +8 -0
- package/build/modules/user/store.js +21 -1
- package/package.json +3 -2
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const react_1 = require("react");
|
|
4
|
+
const api_1 = require("@ludo.ninja/api");
|
|
5
|
+
const type_1 = require("@ludo.ninja/ui/build/system/Alert/type");
|
|
6
|
+
const store_1 = require("../../../../modules/user/store");
|
|
7
|
+
const ui_1 = require("../../../../store/ui");
|
|
8
|
+
const schema_1 = require("@ludo.ninja/api/build/graphql_tools/__generated__/experiencesHost/schema");
|
|
9
|
+
const useFetchMyActivityStreak = () => {
|
|
10
|
+
const { isSignedIn, setUserStreak, resetUserStreak, setErrorStreak, setIsLoadingStreak, } = (0, store_1.useUserStore)((state) => ({
|
|
11
|
+
isSignedIn: state.isSignedIn,
|
|
12
|
+
setUserStreak: state.setUserStreak,
|
|
13
|
+
resetUserStreak: state.resetUserStreak,
|
|
14
|
+
setErrorStreak: state.setErrorStreak,
|
|
15
|
+
setIsLoadingStreak: state.setIsLoadingStreak,
|
|
16
|
+
}));
|
|
17
|
+
const { openAlert } = (0, ui_1.useUiStore)((state) => ({
|
|
18
|
+
openAlert: state.openAlert
|
|
19
|
+
}));
|
|
20
|
+
const [fetchActivityStreak] = (0, schema_1.useFetchMyActivityStreakLazyQuery)({
|
|
21
|
+
context: {
|
|
22
|
+
uri: api_1.hosts.experiencesHost,
|
|
23
|
+
},
|
|
24
|
+
onCompleted: ({ fetchMyActivityStreak }) => {
|
|
25
|
+
setIsLoadingStreak(false);
|
|
26
|
+
const userStreak = {
|
|
27
|
+
...store_1.initialUserStreak,
|
|
28
|
+
...fetchMyActivityStreak
|
|
29
|
+
};
|
|
30
|
+
setUserStreak({
|
|
31
|
+
nextStreak: userStreak.nextStreak,
|
|
32
|
+
nextBonus: userStreak.nextBonus,
|
|
33
|
+
totalDays: userStreak.totalDays,
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
onError: (err) => {
|
|
37
|
+
openAlert({
|
|
38
|
+
type: type_1.alertVariants.error,
|
|
39
|
+
caption: err.message,
|
|
40
|
+
});
|
|
41
|
+
resetUserStreak();
|
|
42
|
+
setErrorStreak(err);
|
|
43
|
+
setIsLoadingStreak(false);
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
(0, react_1.useEffect)(() => {
|
|
47
|
+
if (isSignedIn) {
|
|
48
|
+
setIsLoadingStreak(true);
|
|
49
|
+
fetchActivityStreak();
|
|
50
|
+
}
|
|
51
|
+
}, [isSignedIn]);
|
|
52
|
+
};
|
|
53
|
+
exports.default = useFetchMyActivityStreak;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,140 @@
|
|
|
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 jsx_runtime_1 = require("react/jsx-runtime");
|
|
7
|
+
const styled_components_1 = __importDefault(require("styled-components"));
|
|
8
|
+
const vars_1 = require("../../../fonts/vars");
|
|
9
|
+
const colors_1 = require("@ludo.ninja/ui/build/styles/colors");
|
|
10
|
+
const ScreenWidth_1 = require("../../../styles/ScreenWidth");
|
|
11
|
+
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
12
|
+
const store_1 = require("../../../modules/user/store");
|
|
13
|
+
const rc_tooltip_1 = __importDefault(require("rc-tooltip"));
|
|
14
|
+
const react_loading_skeleton_1 = __importDefault(require("react-loading-skeleton"));
|
|
15
|
+
const Wrapper = styled_components_1.default.div `
|
|
16
|
+
display: flex;
|
|
17
|
+
gap: 8px;
|
|
18
|
+
flex-wrap: wrap;
|
|
19
|
+
|
|
20
|
+
color: ${colors_1.TextGrayColor};
|
|
21
|
+
font-family: ${vars_1.poppinsFontVarCss.css};
|
|
22
|
+
font-size: 12px;
|
|
23
|
+
font-style: normal;
|
|
24
|
+
font-weight: 500;
|
|
25
|
+
line-height: 16px;
|
|
26
|
+
.streak-count {
|
|
27
|
+
display: flex;
|
|
28
|
+
align-items: center;
|
|
29
|
+
gap: 4px;
|
|
30
|
+
.skeleton-streak {
|
|
31
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
32
|
+
width: ${(0, _4k_1.adaptiveValueCalc)(85)};
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
.streak-bonus {
|
|
37
|
+
display: flex;
|
|
38
|
+
align-items: center;
|
|
39
|
+
gap: 8px;
|
|
40
|
+
color: ${colors_1.ProgressColor};
|
|
41
|
+
.skeleton-streak {
|
|
42
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
43
|
+
width: ${(0, _4k_1.adaptiveValueCalc)(215)};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.testRoot {
|
|
49
|
+
background-color: red;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.skeleton-streak {
|
|
53
|
+
border-radius: 16px;
|
|
54
|
+
height: 16px;
|
|
55
|
+
|
|
56
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
57
|
+
border-radius: ${(0, _4k_1.adaptiveValueCalc)(16)};
|
|
58
|
+
height: ${(0, _4k_1.adaptiveValueCalc)(16)};
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
${ScreenWidth_1.mediaQuery.minWidthFourK} {
|
|
63
|
+
font-size: ${(0, _4k_1.adaptiveValueCalc)(12)};
|
|
64
|
+
line-height: ${(0, _4k_1.adaptiveValueCalc)(16)};
|
|
65
|
+
gap: ${(0, _4k_1.adaptiveValueCalc)(8)};
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
const StreakInfo = styled_components_1.default.div `
|
|
69
|
+
display: flex;
|
|
70
|
+
width: 356px;
|
|
71
|
+
//height: 100px;
|
|
72
|
+
flex-direction: column;
|
|
73
|
+
//justify-content: center;
|
|
74
|
+
align-items: flex-start;
|
|
75
|
+
gap: 6px;
|
|
76
|
+
flex-shrink: 0;
|
|
77
|
+
|
|
78
|
+
.title {
|
|
79
|
+
color: ${colors_1.BlackColor};
|
|
80
|
+
font-size: 15px;
|
|
81
|
+
font-style: normal;
|
|
82
|
+
font-weight: 500;
|
|
83
|
+
line-height: 22px;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.description {
|
|
87
|
+
width: 100%;
|
|
88
|
+
text-wrap: auto;
|
|
89
|
+
text-align: left;
|
|
90
|
+
color: ${colors_1.TextGrayColor};
|
|
91
|
+
|
|
92
|
+
/* Desktop/Text Small */
|
|
93
|
+
font-family: ${vars_1.dmsansFontVarCss.css};
|
|
94
|
+
font-size: 13px;
|
|
95
|
+
font-style: normal;
|
|
96
|
+
font-weight: 400;
|
|
97
|
+
line-height: 18px;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
ul {
|
|
101
|
+
list-style-type: none;
|
|
102
|
+
margin: 0;
|
|
103
|
+
padding: 0;
|
|
104
|
+
}
|
|
105
|
+
span {
|
|
106
|
+
color: ${colors_1.TextGrayColor};
|
|
107
|
+
margin-right: 4px;
|
|
108
|
+
font-weight: 700;
|
|
109
|
+
}
|
|
110
|
+
`;
|
|
111
|
+
const CheckSVGIcon = () => {
|
|
112
|
+
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" }) }));
|
|
113
|
+
};
|
|
114
|
+
const TooltipSVGIcon = () => {
|
|
115
|
+
return ((0, jsx_runtime_1.jsxs)("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)("circle", { cx: "5.99961", cy: "5.99998", r: "5.4", fill: "#CFD5EA" }), (0, jsx_runtime_1.jsx)("path", { d: "M5.45313 7.25185C5.45313 6.9264 5.509 6.65077 5.62074 6.42495C5.73247 6.19249 5.8705 5.99323 6.03482 5.82719C6.19914 5.6545 6.36017 5.49178 6.51792 5.33902C6.68224 5.17961 6.82027 5.01357 6.932 4.84088C7.04374 4.66155 7.09961 4.44902 7.09961 4.20327C7.09961 4.03723 7.06017 3.86786 6.9813 3.69517C6.909 3.52249 6.78083 3.37969 6.59679 3.26678C6.41276 3.14723 6.1597 3.08745 5.83764 3.08745C5.51557 3.08745 5.2428 3.15055 5.01933 3.27674C4.80243 3.40293 4.63153 3.56898 4.50665 3.77488C4.38834 3.98077 4.31933 4.19995 4.29961 4.43241H3.59961C3.61933 4.06711 3.71792 3.7317 3.89538 3.42618C4.07942 3.11402 4.32919 2.86495 4.64468 2.67898C4.96675 2.49301 5.34468 2.40002 5.77848 2.40002C6.25172 2.40002 6.63623 2.48969 6.932 2.66902C7.23435 2.8417 7.45454 3.06752 7.59257 3.34648C7.7306 3.61879 7.79961 3.90439 7.79961 4.20327C7.79961 4.51543 7.74374 4.77779 7.632 4.99032C7.52684 5.19622 7.3921 5.38219 7.22778 5.54823C7.07003 5.70764 6.909 5.86372 6.74468 6.01648C6.58036 6.16924 6.44233 6.34525 6.3306 6.5445C6.22543 6.73711 6.17285 6.9729 6.17285 7.25185H5.45313Z", fill: "#696F90" }), (0, jsx_runtime_1.jsx)("path", { d: "M5.81299 9.78175C5.61881 9.78175 5.45594 9.72118 5.3244 9.60002C5.19286 9.47887 5.12708 9.32887 5.12708 9.15002C5.12708 8.97118 5.19286 8.82118 5.3244 8.70002C5.45594 8.57887 5.61881 8.51829 5.81299 8.51829C6.00091 8.51829 6.16064 8.57887 6.29218 8.70002C6.42373 8.82118 6.4895 8.97118 6.4895 9.15002C6.4895 9.32887 6.42373 9.47887 6.29218 9.60002C6.16064 9.72118 6.00091 9.78175 5.81299 9.78175Z", fill: "#696F90" })] }));
|
|
116
|
+
};
|
|
117
|
+
const UserStreak = ({ className, style }) => {
|
|
118
|
+
const { userStreak, isLoadingStreak, errorStreak } = (0, store_1.useUserStore)((state) => ({
|
|
119
|
+
userStreak: state.userStreak,
|
|
120
|
+
isLoadingStreak: state.isLoadingStreak,
|
|
121
|
+
errorStreak: state.errorStreak,
|
|
122
|
+
}));
|
|
123
|
+
const isShowSkeleton = isLoadingStreak || errorStreak;
|
|
124
|
+
return ((0, jsx_runtime_1.jsxs)(Wrapper, { className: className, style: style, children: [(0, jsx_runtime_1.jsx)("div", { className: 'streak-count', children: isShowSkeleton ? ((0, jsx_runtime_1.jsx)(react_loading_skeleton_1.default, { className: 'skeleton-streak', width: '85px' })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("span", { children: [userStreak.totalDays, " Days Streak"] }), (0, jsx_runtime_1.jsx)(CheckSVGIcon, {})] })) }), (0, jsx_runtime_1.jsx)("div", { className: 'streak-bonus', children: isShowSkeleton ? ((0, jsx_runtime_1.jsx)(react_loading_skeleton_1.default, { className: 'skeleton-streak', width: '215px' })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsxs)("span", { children: ["Next Bonus: ", userStreak.nextStreak, " Days Streak +", userStreak.nextBonus, " XP."] }), (0, jsx_runtime_1.jsx)(rc_tooltip_1.default, { placement: "bottomLeft", trigger: ['hover', 'click', 'focus'], showArrow: false, styles: {
|
|
125
|
+
root: {
|
|
126
|
+
backgroundColor: '#ffffff',
|
|
127
|
+
opacity: 1,
|
|
128
|
+
boxShadow: ' 0px 4px 16px -2px rgba(0, 0, 0, 0.14)',
|
|
129
|
+
borderRadius: '12px',
|
|
130
|
+
},
|
|
131
|
+
inner: {
|
|
132
|
+
borderRadius: '12px',
|
|
133
|
+
border: 'none',
|
|
134
|
+
},
|
|
135
|
+
}, classNames: { root: 'testRoot', inner: 'testInner' }, overlay: (0, jsx_runtime_1.jsxs)(StreakInfo, { children: [(0, jsx_runtime_1.jsx)("div", { className: 'title', children: "Keep Your Daily Streak Going!" }), (0, jsx_runtime_1.jsxs)("ul", { className: 'description', children: [(0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("span", { children: "\u2022 Visit an Opportunity:" }), "Explore one from the \"New Opportunities\" section to maintain your streak."] }), (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("span", { children: "\u2022 Share an Opportunity:" }), "Use the available sharing options to tell a friend and keep earning."] }), (0, jsx_runtime_1.jsxs)("li", { children: [(0, jsx_runtime_1.jsx)("span", { children: "\u2022 Reminder:" }), "Maintain your streak to increase your daily XP and reach exciting milestone bonuses!"] })] })] }), children: (0, jsx_runtime_1.jsx)("span", { style: {
|
|
136
|
+
cursor: 'pointer',
|
|
137
|
+
display: 'flex',
|
|
138
|
+
alignItems: 'center',
|
|
139
|
+
}, children: (0, jsx_runtime_1.jsx)(TooltipSVGIcon, {}) }) })] })) })] }));
|
|
140
|
+
};
|
|
@@ -22,5 +22,5 @@ interface IUseSearch {
|
|
|
22
22
|
searchCloseButton: ReactNode;
|
|
23
23
|
}) => ReactNode;
|
|
24
24
|
}
|
|
25
|
-
export declare const SearchInputContainer: ({ onFocusHandler, isClearOnBlur, initializeInputComponent }: IUseSearch) => import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export declare const SearchInputContainer: ({ onFocusHandler, isClearOnBlur, initializeInputComponent, }: IUseSearch) => import("react/jsx-runtime").JSX.Element;
|
|
26
26
|
export {};
|
|
@@ -28,25 +28,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
29
|
exports.SearchInputContainer = void 0;
|
|
30
30
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
31
|
+
const react_1 = __importStar(require("react"));
|
|
32
|
+
// import { useRouter } from "next/router";
|
|
33
|
+
const lodash_debounce_1 = __importDefault(require("lodash.debounce"));
|
|
34
|
+
const styled_components_1 = __importStar(require("styled-components"));
|
|
35
|
+
const colors_1 = require("@ludo.ninja/ui/build/styles/colors");
|
|
36
|
+
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
37
|
+
const utils_1 = require("@ludo.ninja/utils");
|
|
31
38
|
const useFetchFindAllTopEntitiesByName_1 = require("../../api/server-search/queries/useFetchFindAllTopEntitiesByName");
|
|
32
39
|
const searchCloseMoreButtons_1 = __importDefault(require("./searchCloseMoreButtons"));
|
|
33
40
|
const searchSuggestions_1 = __importDefault(require("./searchSuggestions"));
|
|
34
|
-
const back_svg_1 = __importDefault(require("../../public/search/back"));
|
|
35
41
|
const env_1 = require("../../store/env");
|
|
36
42
|
const ui_1 = require("../../store/ui");
|
|
37
43
|
const ScreenWidth_1 = require("../../styles/ScreenWidth");
|
|
38
44
|
const screen_1 = require("../../utils/screen");
|
|
39
45
|
const seacrhTabs_1 = require("../../utils/seacrhTabs");
|
|
46
|
+
const back_svg_1 = __importDefault(require("../../public/search/back"));
|
|
40
47
|
const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
|
|
41
|
-
const colors_1 = require("@ludo.ninja/ui/build/styles/colors");
|
|
42
|
-
const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
43
|
-
const utils_1 = require("@ludo.ninja/utils");
|
|
44
|
-
// import { useRouter } from "next/router";
|
|
45
|
-
const lodash_debounce_1 = __importDefault(require("lodash.debounce"));
|
|
46
|
-
const react_1 = __importStar(require("react"));
|
|
47
|
-
const styled_components_1 = __importStar(require("styled-components"));
|
|
48
48
|
const enterKey = "Enter";
|
|
49
|
-
const SearchInputContainer = ({ onFocusHandler, isClearOnBlur, initializeInputComponent }) => {
|
|
49
|
+
const SearchInputContainer = ({ onFocusHandler, isClearOnBlur, initializeInputComponent, }) => {
|
|
50
50
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
51
51
|
const inputSearch = (0, react_1.useRef)(null);
|
|
52
52
|
const [searchValue, setSearchValue] = (0, react_1.useState)("");
|
|
@@ -84,8 +84,10 @@ const SearchInputContainer = ({ onFocusHandler, isClearOnBlur, initializeInputCo
|
|
|
84
84
|
}, [debouncedValue]);
|
|
85
85
|
const [isMobileOpen, setIsMobileOpen] = (0, react_1.useState)(false);
|
|
86
86
|
const Container = isMobileOpen ? SMobileContainer : react_1.default.Fragment;
|
|
87
|
-
const SearchContainer = isMobileOpen
|
|
88
|
-
|
|
87
|
+
const SearchContainer = isMobileOpen
|
|
88
|
+
? SMobileSearchContainer
|
|
89
|
+
: react_1.default.Fragment;
|
|
90
|
+
const searchSuggestion = ((0, jsx_runtime_1.jsx)(searchSuggestions_1.default, { isLoading: loading || isDebounceLoading, searchTerm: debouncedValue, assets: topEntities?.assets || [], profiles: topEntities?.profiles || [], collections: topEntities?.collections || [] }));
|
|
89
91
|
return ((0, jsx_runtime_1.jsxs)(Container, { children: [(0, jsx_runtime_1.jsxs)(SearchContainer, { children: [isMobileOpen && ((0, jsx_runtime_1.jsx)(back_svg_1.default, { onClick: () => {
|
|
90
92
|
setIsMobileOpen(false);
|
|
91
93
|
(0, utils_1.rootRemoveOverflow)();
|
|
@@ -143,7 +145,8 @@ const SearchInputContainer = ({ onFocusHandler, isClearOnBlur, initializeInputCo
|
|
|
143
145
|
const newSearchValue = value.length ? searchValue : "";
|
|
144
146
|
const searchDomain = ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE]["search"];
|
|
145
147
|
const currentPath = window.location.pathname;
|
|
146
|
-
if (searchDomain === window.origin &&
|
|
148
|
+
if (searchDomain === window.origin &&
|
|
149
|
+
seacrhTabs_1.searchTabs.find((el) => currentPath.includes(el.link))) {
|
|
147
150
|
// await router.replace(
|
|
148
151
|
// {
|
|
149
152
|
// query: { ...router.query, term: newSearchValue },
|
|
@@ -171,13 +174,13 @@ const SearchInputContainer = ({ onFocusHandler, isClearOnBlur, initializeInputCo
|
|
|
171
174
|
}
|
|
172
175
|
},
|
|
173
176
|
},
|
|
174
|
-
searchSuggestion: !isMobile && searchValue && (0, jsx_runtime_1.jsx)("div", { className: "suggestionBar", children: searchSuggestion
|
|
177
|
+
searchSuggestion: !isMobile && searchValue && ((0, jsx_runtime_1.jsx)("div", { className: "suggestionBar", children: searchSuggestion })),
|
|
175
178
|
searchCloseButton: ((0, jsx_runtime_1.jsx)(searchCloseMoreButtons_1.default, { isNeedToShow: Boolean(searchValue.length), position: {
|
|
176
179
|
top: "50%",
|
|
177
180
|
right: "0",
|
|
178
181
|
transform: "translate(-50%, -50%)",
|
|
179
182
|
}, clearSearchValue: setSearchValue })),
|
|
180
|
-
})] }), isMobileOpen && searchValue && (0, jsx_runtime_1.jsx)(SSuggestions, { children: searchSuggestion
|
|
183
|
+
})] }), isMobileOpen && searchValue && ((0, jsx_runtime_1.jsx)(SSuggestions, { children: searchSuggestion }))] }));
|
|
181
184
|
};
|
|
182
185
|
exports.SearchInputContainer = SearchInputContainer;
|
|
183
186
|
const show = (0, styled_components_1.keyframes) `
|
|
@@ -71,11 +71,11 @@ const StyledSearchSuggestions = styled_components_1.default.div `
|
|
|
71
71
|
`;
|
|
72
72
|
// Components
|
|
73
73
|
const SearchSuggestions = ({ searchTerm, assets, profiles, collections, isLoading }) => {
|
|
74
|
-
const isNotFound = !assets?.length && !profiles?.length && !collections?.length;
|
|
75
74
|
const { getMediaENVDomain, NEXT_PUBLIC_ENV_VALUE } = (0, env_1.useEnvStore)((state) => ({
|
|
76
75
|
getMediaENVDomain: state.getMediaDomain,
|
|
77
76
|
NEXT_PUBLIC_ENV_VALUE: state.NEXT_PUBLIC_ENV_VALUE,
|
|
78
77
|
}));
|
|
78
|
+
const isNotFound = !assets?.length && !profiles?.length && !collections?.length;
|
|
79
79
|
return ((0, jsx_runtime_1.jsx)(StyledSearchSuggestions, { children: (0, jsx_runtime_1.jsxs)("div", { className: "content", children: [isLoading && (0, jsx_runtime_1.jsx)(searchSuggestionsItemSkeleton_1.SearchSuggestionsItemsSkeleton, {}), !isLoading &&
|
|
80
80
|
(isNotFound ? ((0, jsx_runtime_1.jsx)(searchSuggestionsNotFound_1.default, { notFoundText: searchTerm })) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("div", { className: "scroller", children: [
|
|
81
81
|
...(assets?.length
|
|
@@ -26,6 +26,7 @@ const GlobalLayout = ({ children }) => {
|
|
|
26
26
|
(0, useFetchMyExperienceWithLevel_1.default)();
|
|
27
27
|
(0, useMultiAudio_1.default)();
|
|
28
28
|
(0, useAuthVerification_1.useAuthVerification)();
|
|
29
|
+
(0, useFetchMyExperienceWithLevel_1.default)();
|
|
29
30
|
const NEXT_PUBLIC_ENV_VALUE = (0, env_1.useEnvStore)((state) => state.NEXT_PUBLIC_ENV_VALUE);
|
|
30
31
|
const envValue = NEXT_PUBLIC_ENV_VALUE !== 'prod' ? NEXT_PUBLIC_ENV_VALUE : '';
|
|
31
32
|
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(profileDataInitialization_1.ProfileDataInitialization, {}), (0, jsx_runtime_1.jsx)(envLine_1.default, { isNeedToShow: envValue }), (0, jsx_runtime_1.jsx)(globalStyles_1.default, {}), children, (0, jsx_runtime_1.jsx)(CreatorNotifications_1.CreatorNotifications, {}), (0, jsx_runtime_1.jsx)(screen_1.InitializeAppHeight, {}), (0, jsx_runtime_1.jsx)(SubscriberNotifications_1.SubscriberNotification, {}), (0, jsx_runtime_1.jsx)(Overlay_1.default, {}), (0, jsx_runtime_1.jsx)(initializer_1.SidebarInitializer, {}), (0, jsx_runtime_1.jsx)(Alert_1.default, {}), (0, jsx_runtime_1.jsx)(Modal_1.default, {}), (0, jsx_runtime_1.jsx)(ModalSidebar_1.default, {}), (0, jsx_runtime_1.jsx)(CreatorModalSidebarPortal_1.CreatorModalSidebarPortal, {}), (0, jsx_runtime_1.jsx)(sessionScroll_1.DeleteScrollStateInterceptor, {})] }));
|
|
@@ -3,6 +3,7 @@ import { ApolloError } from "@apollo/client";
|
|
|
3
3
|
import { experiencesSchema as schema } from "@ludo.ninja/api";
|
|
4
4
|
import { identitySchema } from "@ludo.ninja/api";
|
|
5
5
|
import { ProfileEntity } from "@ludo.ninja/core";
|
|
6
|
+
export declare const initialUserStreak: Omit<schema.IActivityStreak, 'userId'>;
|
|
6
7
|
type TMyProfile = identitySchema.IFetchMyProfileV2Query["fetchMyProfileV2"];
|
|
7
8
|
export interface IUserStore {
|
|
8
9
|
user: IUser | null;
|
|
@@ -25,6 +26,13 @@ export interface IUserStore {
|
|
|
25
26
|
setInviteCodes: (inviteCodes: identitySchema.IInviteCode[]) => void;
|
|
26
27
|
myShareLink: string;
|
|
27
28
|
setMyShareLink: (myShareLink: string) => void;
|
|
29
|
+
userStreak: Omit<schema.IActivityStreak, 'userId'>;
|
|
30
|
+
setUserStreak: (userStreak: Omit<schema.IActivityStreak, 'userId'>) => void;
|
|
31
|
+
resetUserStreak: () => void;
|
|
32
|
+
isLoadingStreak: boolean;
|
|
33
|
+
setIsLoadingStreak: (isLoadingStreak: boolean) => void;
|
|
34
|
+
errorStreak: ApolloError | undefined;
|
|
35
|
+
setErrorStreak: (isErrorStreak: ApolloError | undefined) => void;
|
|
28
36
|
}
|
|
29
37
|
export declare const UserProvider: ({ children, initialState }: {
|
|
30
38
|
children: import("react").ReactNode;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useUserStore = exports.UserProvider = void 0;
|
|
3
|
+
exports.useUserStore = exports.UserProvider = exports.initialUserStreak = void 0;
|
|
4
4
|
const core_1 = require("@ludo.ninja/core");
|
|
5
5
|
const next_zustand_1 = require("next-zustand");
|
|
6
6
|
const shallow_1 = require("zustand/shallow");
|
|
@@ -10,6 +10,11 @@ const initialUserExp = {
|
|
|
10
10
|
levelMaxXps: 0,
|
|
11
11
|
levelMinXps: 0,
|
|
12
12
|
};
|
|
13
|
+
exports.initialUserStreak = {
|
|
14
|
+
totalDays: 0,
|
|
15
|
+
nextStreak: 5,
|
|
16
|
+
nextBonus: 100,
|
|
17
|
+
};
|
|
13
18
|
const creators = (0, next_zustand_1.createProvider)()((setState) => ({
|
|
14
19
|
user: null,
|
|
15
20
|
isSignedIn: false,
|
|
@@ -72,6 +77,21 @@ const creators = (0, next_zustand_1.createProvider)()((setState) => ({
|
|
|
72
77
|
setMyShareLink: (myShareLink) => {
|
|
73
78
|
setState({ myShareLink });
|
|
74
79
|
},
|
|
80
|
+
userStreak: exports.initialUserStreak,
|
|
81
|
+
setUserStreak: (userStreak) => {
|
|
82
|
+
setState({ userStreak });
|
|
83
|
+
},
|
|
84
|
+
resetUserStreak: () => {
|
|
85
|
+
setState({ userStreak: exports.initialUserStreak });
|
|
86
|
+
},
|
|
87
|
+
isLoadingStreak: false,
|
|
88
|
+
setIsLoadingStreak: (isLoadingStreak) => {
|
|
89
|
+
setState({ isLoadingStreak });
|
|
90
|
+
},
|
|
91
|
+
errorStreak: undefined,
|
|
92
|
+
setErrorStreak: (errorStreak) => {
|
|
93
|
+
setState({ errorStreak });
|
|
94
|
+
},
|
|
75
95
|
}), shallow_1.shallow);
|
|
76
96
|
exports.UserProvider = creators.Provider;
|
|
77
97
|
exports.useUserStore = creators.getUseStore();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ludo.ninja/components",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.41",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"types": "build/index.d.ts",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"publish": "npm publish --access public -workspace @ludo.ninja/components"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@ludo.ninja/api": "^3.0.
|
|
26
|
+
"@ludo.ninja/api": "^3.0.31",
|
|
27
27
|
"@react-three/drei": "^9.68.3",
|
|
28
28
|
"@react-three/fiber": "^8.13.0",
|
|
29
29
|
"chart.js": "^4.4.3",
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"path-to-regexp": "^6.2.1",
|
|
41
41
|
"prettier": "^2.7.1",
|
|
42
42
|
"qs": "^6.12.1",
|
|
43
|
+
"rc-tooltip": "^6.3.1",
|
|
43
44
|
"react": "^18.3.1",
|
|
44
45
|
"react-cropper": "^2.1.8",
|
|
45
46
|
"react-date-picker": "^11.0.0",
|