Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
title: 'Custom Checkbox Item',
isSelectable: true,
isSelected: checkboxItemEnabled,
isReadOnly: false,
parentKey: Utils.utilityHelpers.defaultKeys.MENU,
}, {
key: 'readonly-item',
title: 'Custom ReadOnly Item',
isSelectable: true,
isReadOnly: true,
parentKey: Utils.utilityHelpers.defaultKeys.MENU,
}, {
key: 'additional-3',
contentLocation: Utils.utilityHelpers.locations.FOOTER,
title: 'Custom Footer',
parentKey: Utils.utilityHelpers.defaultKeys.MENU,
}];
/**
* The data provided for utilityConfig will be visible in the ApplicationLayout's header in the
* standard rendering mode and within the menus in the compact rendering mode.
*
* The ApplicationLayout's Utils export provides a helper function named getDefaultUtilityConfig that will
* generate the configuration for the standard set of utility options. If the standard configuration is not
* desirable, an entirely custom configuration can be used instead.
*/
const utilityConfig = Object.freeze({
title: 'Swanson, Henry',
accessory: userAvatar,
menuItems: Utils.utilityHelpers.getDefaultUtilityItems(intl, userData, customUtilityItems),
initialSelectedKey: Utils.utilityHelpers.defaultKeys.MENU,
onChange: (event, itemData, disclose) => {
render() {
const { intl, location } = this.props;
const { checkboxItemEnabled } = this.state;
const customUtilityItems = [{
key: 'additional-1',
title: 'Drill-in Item',
childKeys: [
'additional-sub-1',
'additional-sub-2',
],
parentKey: Utils.utilityHelpers.defaultKeys.MENU,
}, {
key: 'additional-sub-1',
title: 'Additional Item 1 - Sub 1',
parentKey: 'additional-1',
}, {
key: 'additional-sub-2',
title: 'Additional Item 1 - Sub 2',
parentKey: 'additional-1',
}, {
key: 'checkbox-item',
title: 'Custom Checkbox Item',
isSelectable: true,
isSelected: checkboxItemEnabled,
isReadOnly: false,
parentKey: Utils.utilityHelpers.defaultKeys.MENU,
}, {
render() {
const { intl, location } = this.props;
const { checkboxItemEnabled } = this.state;
const customUtilityItems = [{
key: 'additional-1',
title: 'Drill-in Item',
childKeys: [
'additional-sub-1',
'additional-sub-2',
],
parentKey: Utils.utilityHelpers.defaultKeys.MENU,
}, {
key: 'additional-sub-1',
title: 'Additional Item 1 - Sub 1',
parentKey: 'additional-1',
}, {
key: 'additional-sub-2',
title: 'Additional Item 1 - Sub 2',
parentKey: 'additional-1',
}, {
key: 'checkbox-item',
title: 'Custom Checkbox Item',
isSelectable: true,
isSelected: checkboxItemEnabled,
isReadOnly: false,
parentKey: Utils.utilityHelpers.defaultKeys.MENU,
}, {
parentKey: Utils.utilityHelpers.defaultKeys.MENU,
}, {
key: 'additional-sub-1',
title: 'Additional Item 1 - Sub 1',
parentKey: 'additional-1',
}, {
key: 'additional-sub-2',
title: 'Additional Item 1 - Sub 2',
parentKey: 'additional-1',
}, {
key: 'checkbox-item',
title: 'Custom Checkbox Item',
isSelectable: true,
isSelected: checkboxItemEnabled,
isReadOnly: false,
parentKey: Utils.utilityHelpers.defaultKeys.MENU,
}, {
key: 'readonly-item',
title: 'Custom ReadOnly Item',
isSelectable: true,
isReadOnly: true,
parentKey: Utils.utilityHelpers.defaultKeys.MENU,
}, {
key: 'additional-3',
contentLocation: Utils.utilityHelpers.locations.FOOTER,
title: 'Custom Footer',
parentKey: Utils.utilityHelpers.defaultKeys.MENU,
}];
/**
* The data provided for utilityConfig will be visible in the ApplicationLayout's header in the
* standard rendering mode and within the menus in the compact rendering mode.