@atlaskit/navigation-system
Version:
The latest navigation system for Atlassian apps.
16 lines (15 loc) • 623 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.useIsCompactTopNav = useIsCompactTopNav;
var _useTopNavBreakpoints = require("./use-top-nav-breakpoints");
/**
* Use the enclosing TopNav's border-box width, matching its 48rem sm breakpoint.
* Until that width is measured, use an icon-only fallback: the server cannot know
* the container width, and text buttons can overlap at narrow widths.
*/
function useIsCompactTopNav() {
var breakpoints = (0, _useTopNavBreakpoints.useTopNavBreakpoints)();
return breakpoints ? !breakpoints.hasMeasured || breakpoints.belowSm : false;
}