Skip to content

Commit

Permalink
Avoiding replaceText if localNav
Browse files Browse the repository at this point in the history
  • Loading branch information
bandana147 committed Nov 7, 2024
1 parent a2122ce commit 096eecf
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions libs/blocks/global-navigation/utilities/utilities.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,18 +424,17 @@ export const transformTemplateToMobile = async (popup, item, localnav = false) =
return { name, links };
});
const CTA = popup.querySelector('.feds-cta')?.outerHTML ?? '';
const mainmenu = `
const mainMenu = `
<span class="main-menu">
<svg xmlns="http://www.w3.org/2000/svg" style="translate:0 3px" width="7" height="12" viewBox="0 0 7 12" fill="none"><path d="M5.55579 1L1.09618 5.45961C1.05728 5.4985 1.0571 5.56151 1.09577 5.60062L5.51027 10.0661" stroke="black" stroke-width="2" stroke-linecap="round"/></svg>
{{main-menu}}
</span>
`;
const mainMenuLocalized = await replaceText(mainmenu, getFedsPlaceholderConfig());
const brand = document.querySelector('.feds-brand').outerHTML;
const breadCrumbs = document.querySelector('.feds-breadcrumbs')?.outerHTML;
popup.innerHTML = `
<div class="top-bar">
${localnav ? brand : mainMenuLocalized}
${localnav ? brand : await replaceText(mainMenu, getFedsPlaceholderConfig())}
<span class="close-icon" style="width:11.5px;height:11.5px;padding:12px;cursor:pointer">
<svg xmlns="http://www.w3.org/2000/svg" width="14" height="14" viewBox="0 0 14 14" fill="none">
<path d="M1.5 1L13 12.5" stroke="black" stroke-width="1.7037" stroke-linecap="round"/>
Expand Down

0 comments on commit 096eecf

Please sign in to comment.