UNPKG

@payfit/unity-components

Version:

55 lines (54 loc) 2.13 kB
import { isMobileBreakpoint as e, useBreakpointListener as t } from "../../../hooks/use-breakpoint-listener.js"; import { Button as n } from "../../button/Button.js"; import { useAppMenuContext as r } from "./AppMenu.context.js"; import { PayFitBrand as i } from "../../payfit-brand/PayFitBrand.js"; import { PayFitBrandPreprod as a } from "../../payfit-brand/PayFitPreprod.js"; import { jsx as o, jsxs as s } from "react/jsx-runtime"; import { useIntl as c } from "react-intl"; import { Link as l } from "react-aria-components/Link"; //#region src/components/app-menu/parts/AppMenuHeader.tsx var u = ({ environment: u, brandLabel: d, notificationsComponent: f, searchComponent: p, renderLink: m = ({ children: e }) => /* @__PURE__ */ o(l, { href: "/", children: e }) }) => { let { isMobileMenuOpen: h, toggleMobileMenu: g } = r(), _ = c(), v = e(t()); return /* @__PURE__ */ s("header", { className: "uy:flex uy:flex-col uy:gap-y-200 uy:pl-25 uy:pr-25", children: [/* @__PURE__ */ s("div", { className: "uy:flex uy:items-center", children: [/* @__PURE__ */ o("div", { className: "uy:flex-1", children: m({ children: u === "prod" ? /* @__PURE__ */ o(i, { label: d, width: v ? 36 : 104, showOnlyMonogram: v }) : /* @__PURE__ */ o(a, { label: d, env: u }) }) }), /* @__PURE__ */ s("div", { className: "uy:flex uy:gap-150 uy:items-center", children: [f, /* @__PURE__ */ o("div", { className: "uy:block uy:md:hidden", children: /* @__PURE__ */ o(n, { variant: "ghost", color: "neutral", prefixIcon: h ? "CloseOutlined" : "ListOutlined", onPress: g, "aria-expanded": h, "aria-controls": "app-menu-nav-container app-menu-profile-button", children: _.formatMessage({ id: h ? "unity:component:app-menu:header:menu-close" : "unity:component:app-menu:header:menu-open", defaultMessage: h ? "Close navigation" : "Open navigation" }) }) })] })] }), /* @__PURE__ */ o("div", { className: "uy:hidden uy:md:flex", children: p })] }); }; //#endregion export { u as AppMenuHeader };