mautourco-components 0.2.4 → 0.2.5
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.
|
@@ -9,7 +9,7 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx,
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import Button from "../../atoms/Button/Button";
|
|
14
14
|
import { UserCard } from "../../molecules/UserCard/UserCard";
|
|
15
15
|
export var DesktopNav = function (_a) {
|
|
@@ -21,6 +21,12 @@ export var DesktopNav = function (_a) {
|
|
|
21
21
|
};
|
|
22
22
|
return (_jsxs("header", __assign({ className: "header" }, { children: [_jsx("div", __assign({ className: "header-logo" }, { children: _jsx("a", __assign({ href: homeUrl !== null && homeUrl !== void 0 ? homeUrl : "/", onClick: handleLogoClick, className: "header-logo__link" }, { children: Logo ? (_jsx(Logo, { className: "header-logo__image" })) : (_jsx("img", { src: logoUrl, alt: "Mautourco", className: "header-logo__image", draggable: false })) })) })), _jsxs("nav", __assign({ className: "header-nav" }, { children: [_jsx("ul", __assign({ className: "header-nav__items" }, { children: links === null || links === void 0 ? void 0 : links.map(function (it) {
|
|
23
23
|
var isActive = it.label === active;
|
|
24
|
-
return (_jsx("li", __assign({ className: "header__item ".concat(isActive ? "header__item--active" : "") }, { children:
|
|
24
|
+
return (_jsx("li", __assign({ className: "header__item ".concat(isActive ? "header__item--active" : "") }, { children: it.isButton ? (_jsx(Button, __assign({ size: "sm", variant: "outline-secondary", onClick: function (e) {
|
|
25
|
+
e.preventDefault();
|
|
26
|
+
onLinkClick === null || onLinkClick === void 0 ? void 0 : onLinkClick(it);
|
|
27
|
+
} }, { children: it.label }))) : (_jsx("a", __assign({ href: it.route, className: "header__item__link", onClick: function (e) {
|
|
28
|
+
e.preventDefault();
|
|
29
|
+
onLinkClick === null || onLinkClick === void 0 ? void 0 : onLinkClick(it);
|
|
30
|
+
} }, { children: it.label }))) }), it.label));
|
|
25
31
|
}) })), _jsx("div", __assign({ className: "header-nav__user-section ".concat(user ? "header-nav__user-connected-section" : "") }, { children: user ? (_jsx("div", __assign({ className: "header-nav__user-container" }, { children: _jsx(UserCard, { user: user, agencies: agencies || [], selectedAgency: selectedAgency, onSelectAgency: onAgencyChange }) }))) : (_jsx(Button, __assign({ size: "sm", variant: "secondary", onClick: onLogin }, { children: "Login" }))) }))] }))] })));
|
|
26
32
|
};
|
package/package.json
CHANGED
|
@@ -83,18 +83,29 @@ export const DesktopNav: React.FC<DesktopNavProps> = ({
|
|
|
83
83
|
key={it.label}
|
|
84
84
|
className={`header__item ${isActive ? "header__item--active" : ""}`}
|
|
85
85
|
>
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
86
|
+
{it.isButton ? (
|
|
87
|
+
<Button
|
|
88
|
+
size="sm"
|
|
89
|
+
variant="outline-secondary"
|
|
90
|
+
onClick={(e) => {
|
|
91
|
+
e.preventDefault();
|
|
92
|
+
onLinkClick?.(it);
|
|
93
|
+
}}
|
|
94
|
+
>
|
|
95
|
+
{it.label}
|
|
96
|
+
</Button>
|
|
97
|
+
) : (
|
|
98
|
+
<a
|
|
99
|
+
href={it.route}
|
|
100
|
+
className="header__item__link"
|
|
101
|
+
onClick={(e) => {
|
|
102
|
+
e.preventDefault();
|
|
103
|
+
onLinkClick?.(it);
|
|
104
|
+
}}
|
|
105
|
+
>
|
|
106
|
+
{it.label}
|
|
107
|
+
</a>
|
|
108
|
+
)}
|
|
98
109
|
</li>
|
|
99
110
|
);
|
|
100
111
|
})}
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
@apply lg:border-b-4 lg:border-l-0 border-l-4 border-[var(--color-sandy-brown-500)] text-[var(--color-text-brand)];
|
|
35
35
|
font-weight: var(--typography-body-lg-6-font-weight-bold);
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
*:not(button) {
|
|
38
38
|
@apply text-[var(--color-text-brand)];
|
|
39
39
|
}
|
|
40
40
|
}
|