Skip to content

Commit

Permalink
Adding container for for search in standalone gnav
Browse files Browse the repository at this point in the history
  • Loading branch information
Snehal Sonawane authored and Snehal Sonawane committed Sep 4, 2024
1 parent 8df386c commit b67ae71
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 6 additions & 0 deletions libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -813,6 +813,11 @@ class Gnav {
analyticsValue: 'Logo',
});

decorateCustomSearch = () => {
this.elements.customSearch = toFragment`<div class="feds-search"></div>`;
return this.elements.customSearch;

Check warning on line 818 in libs/blocks/global-navigation/global-navigation.js

View check run for this annotation

Codecov / codecov/patch

libs/blocks/global-navigation/global-navigation.js#L817-L818

Added lines #L817 - L818 were not covered by tests
};

decorateMainNav = async () => {
const breadcrumbs = isDesktop.matches ? '' : await this.decorateBreadcrumbs();
this.elements.mainNav = toFragment`<div class="feds-nav"></div>`;
Expand All @@ -822,6 +827,7 @@ class Gnav {
${isDesktop.matches ? '' : this.decorateSearch()}
${this.elements.mainNav}
${isDesktop.matches ? this.decorateSearch() : ''}
${getConfig().searchEnabled === 'on' ? this.decorateCustomSearch() : ''}
</div>
`;

Expand Down
2 changes: 1 addition & 1 deletion libs/navigation/navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const blockConfig = [
name: 'global-navigation',
targetEl: 'header',
appendType: 'prepend',
params: ['imsClientId'],
params: ['imsClientId', 'searchEnabled'],
},
{
key: 'footer',
Expand Down

0 comments on commit b67ae71

Please sign in to comment.