Skip to content

Commit

Permalink
Add option to configure children for unav's help component (#2911)
Browse files Browse the repository at this point in the history
* Fix: Adding configurable help component children

* Lint fix
  • Loading branch information
bandana147 committed Sep 24, 2024
1 parent b600045 commit 3557dd6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions libs/blocks/global-navigation/global-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,14 @@ import {

import { replaceKey, replaceKeyArray } from '../../features/placeholders.js';

function getHelpChildren() {
const { unavHelpChildren } = getConfig();
return unavHelpChildren || [
{ type: 'Support' },
{ type: 'Community' },
];
}

export const CONFIG = {
icons: isDarkMode() ? darkIcons : icons,
delays: {
Expand Down Expand Up @@ -97,13 +105,7 @@ export const CONFIG = {
},
help: {
name: 'help',
attributes: {
children: [
{ type: 'Support' },
{ type: 'Community' },
// { type: 'Jarvis', appid: window.adobeid?.client_id },
],
},
attributes: { children: getHelpChildren() },
},
},
},
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', 'searchEnabled'],
params: ['imsClientId', 'searchEnabled', 'unavHelpChildren'],
},
{
key: 'footer',
Expand Down

0 comments on commit 3557dd6

Please sign in to comment.