@canopy-iiif/app 1.6.2 → 1.6.4

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.
@@ -2536,9 +2536,10 @@ function CanopyHeader(props = {}) {
2536
2536
  title: titleProp,
2537
2537
  logo: SiteLogo
2538
2538
  } = props;
2539
- const navLinks = ensureArray(navLinksProp);
2540
2539
  const PageContext = getSafePageContext();
2541
2540
  const context = React20.useContext(PageContext);
2541
+ const contextPrimaryNav = context && Array.isArray(context.primaryNavigation) ? context.primaryNavigation : [];
2542
+ const navLinks = navLinksProp && navLinksProp.length ? ensureArray(navLinksProp) : ensureArray(contextPrimaryNav);
2542
2543
  const contextNavigation = context && context.navigation ? context.navigation : null;
2543
2544
  const contextSite = context && context.site ? context.site : null;
2544
2545
  const contextSiteTitle = contextSite && typeof contextSite.title === "string" ? contextSite.title.trim() : "";