@ludo.ninja/components 2.2.15 → 2.2.17
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/headers/headerSearch/index.d.ts +4 -1
- package/build/components/headers/headerSearch/index.js +6 -6
- package/build/components/linkTabs/linkTab/index.js +3 -3
- package/build/layouts/base/LWithSearchHeader/index.js +1 -1
- package/build/layouts/pageWithLayout.d.ts +3 -2
- package/package.json +1 -1
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
1
|
+
export type HeaderSearchProps = {
|
|
2
|
+
showXP?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const HeaderSearch: ({ showXP }: HeaderSearchProps) => import("react/jsx-runtime").JSX.Element;
|
|
2
5
|
export default HeaderSearch;
|
|
@@ -4,7 +4,6 @@ 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 header_1 = require("@ludo.ninja/ui/build/components/header");
|
|
8
7
|
const headerExperienceLabel_1 = __importDefault(require("../components/headerExperienceLabel"));
|
|
9
8
|
const headerUserPic_1 = __importDefault(require("../components/headerUserPic"));
|
|
10
9
|
const searchSimpleInput_1 = __importDefault(require("../../search/searchSimpleInput"));
|
|
@@ -13,8 +12,9 @@ const env_1 = require("../../../store/env");
|
|
|
13
12
|
const ui_1 = require("../../../store/ui");
|
|
14
13
|
const auth_1 = require("../../../utils/auth");
|
|
15
14
|
const ludoDomains_1 = require("@ludo.ninja/core/build/ludoDomains");
|
|
15
|
+
const header_1 = require("@ludo.ninja/ui/build/components/header");
|
|
16
16
|
// Component
|
|
17
|
-
const HeaderSearch = () => {
|
|
17
|
+
const HeaderSearch = ({ showXP = true }) => {
|
|
18
18
|
const openSidebar = (0, ui_1.useUiStore)((state) => state.openSidebar);
|
|
19
19
|
const isSignedIn = (0, store_1.useUserStore)((state) => state.isSignedIn);
|
|
20
20
|
const getUser = (0, store_1.useUserStore)((state) => state.user);
|
|
@@ -25,12 +25,12 @@ const HeaderSearch = () => {
|
|
|
25
25
|
login: redirectToLoginWindow,
|
|
26
26
|
openSidebar,
|
|
27
27
|
}, slots: {
|
|
28
|
-
headerExpLabel: (
|
|
29
|
-
headerUserPick: (0, jsx_runtime_1.jsx)(headerUserPic_1.default, { userId: getUser?.userId ||
|
|
30
|
-
logoLinkComponent: ({ children }) => (0, jsx_runtime_1.jsx)("a", { href: ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE][isProd() ? "profile" : "app"], children: children }),
|
|
28
|
+
...(showXP ? { headerExpLabel: (0, jsx_runtime_1.jsx)(headerExperienceLabel_1.default, { userId: getUser?.userId || "" }) } : {}),
|
|
29
|
+
headerUserPick: (0, jsx_runtime_1.jsx)(headerUserPic_1.default, { userId: getUser?.userId || "" }),
|
|
30
|
+
logoLinkComponent: ({ children }) => ((0, jsx_runtime_1.jsx)("a", { href: ludoDomains_1.ludoDomains[NEXT_PUBLIC_ENV_VALUE][isProd() ? "profile" : "app"], children: children })),
|
|
31
31
|
searchInput: ({ setInputFocused }) => {
|
|
32
32
|
// Todo seacrh pages, hide search input from header
|
|
33
|
-
return isProd() ? undefined : (
|
|
33
|
+
return isProd() ? undefined : (0, jsx_runtime_1.jsx)(searchSimpleInput_1.default, { onFocusHandler: setInputFocused });
|
|
34
34
|
},
|
|
35
35
|
}, isSearchStyles: true, isActivatedTheme: true }));
|
|
36
36
|
};
|
|
@@ -14,7 +14,7 @@ const _4k_1 = require("@ludo.ninja/ui/build/utils/4k");
|
|
|
14
14
|
// Styles
|
|
15
15
|
const StyledLinkTab = styled_components_1.default.span `
|
|
16
16
|
position: relative;
|
|
17
|
-
color: ${(props) => (props.isActive ? colors_1.BlackColor : colors_1.
|
|
17
|
+
color: ${(props) => (props.isActive ? colors_1.BlackColor : colors_1.TextDarkGrayColor)};
|
|
18
18
|
cursor: pointer;
|
|
19
19
|
${(props) => (props.isMobile ? typography_1.FH3 : typography_1.FH2)};
|
|
20
20
|
user-select: none;
|
|
@@ -24,7 +24,7 @@ const StyledLinkTab = styled_components_1.default.span `
|
|
|
24
24
|
.count {
|
|
25
25
|
margin-right: 8px;
|
|
26
26
|
font-weight: 600;
|
|
27
|
-
color: ${(props) => (props.isActive ? colors_1.AccentColor : colors_1.
|
|
27
|
+
color: ${(props) => (props.isActive ? colors_1.AccentColor : colors_1.TextDarkGrayColor)};
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
:before {
|
|
@@ -32,7 +32,7 @@ const StyledLinkTab = styled_components_1.default.span `
|
|
|
32
32
|
position: absolute;
|
|
33
33
|
display: block;
|
|
34
34
|
width: 100%;
|
|
35
|
-
height:
|
|
35
|
+
height: 2px;
|
|
36
36
|
bottom: -4px;
|
|
37
37
|
left: 0;
|
|
38
38
|
background-color: #000;
|
|
@@ -7,6 +7,6 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
7
7
|
const Meta_1 = __importDefault(require("../../../components/base/Meta"));
|
|
8
8
|
const headerSearch_1 = __importDefault(require("../../../components/headers/headerSearch"));
|
|
9
9
|
// Component
|
|
10
|
-
const LWithSearchHeader = ({ children }) => ((0, jsx_runtime_1.jsxs)("div", { style: { minHeight: 'var(--app-height)' }, children: [(0, jsx_runtime_1.jsx)(Meta_1.default, {}), (0, jsx_runtime_1.jsx)(headerSearch_1.default, {}), children] }));
|
|
10
|
+
const LWithSearchHeader = ({ children, showXP = true }) => ((0, jsx_runtime_1.jsxs)("div", { style: { minHeight: 'var(--app-height)' }, children: [(0, jsx_runtime_1.jsx)(Meta_1.default, {}), (0, jsx_runtime_1.jsx)(headerSearch_1.default, { showXP: showXP }), children] }));
|
|
11
11
|
// Export
|
|
12
12
|
exports.default = LWithSearchHeader;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import type { ReactElement, ReactNode } from 'react';
|
|
2
1
|
import { PageLWithRegularHeader } from './base/LWithRegularHeader/type';
|
|
3
2
|
import { PageLWithSearchHeader } from './base/LWithSearchHeader/type';
|
|
3
|
+
import type { ReactElement, ReactNode } from "react";
|
|
4
4
|
export type PageWithLayoutType = PageLWithRegularHeader | PageLWithSearchHeader;
|
|
5
|
-
export type LayoutProps = ({ children, }: {
|
|
5
|
+
export type LayoutProps = ({ children, showXP }: {
|
|
6
6
|
children: ReactNode;
|
|
7
|
+
showXP?: boolean;
|
|
7
8
|
}) => ReactElement;
|
|
8
9
|
export default PageWithLayoutType;
|