diff --git a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap index accf1022eba6..cad9213c6917 100644 --- a/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap +++ b/packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap @@ -5915,9 +5915,6 @@ Map { "isRequired": true, "type": "bool", }, - "isSideNavExpanded": Object { - "type": "bool", - }, "onToggle": Object { "isRequired": true, "type": "func", diff --git a/packages/react/src/components/UIShell/HeaderMenu.js b/packages/react/src/components/UIShell/HeaderMenu.js index 099ec465cb02..eda66ff10d48 100644 --- a/packages/react/src/components/UIShell/HeaderMenu.js +++ b/packages/react/src/components/UIShell/HeaderMenu.js @@ -177,8 +177,8 @@ class HeaderMenu extends React.Component { }; const className = cx({ [`${prefix}--header__submenu`]: true, - [customClassName]: true, [`${prefix}--header__submenu--current`]: isCurrentPage, + [customClassName]: !!customClassName, }); // Notes on eslint comments and based on the examples in: diff --git a/packages/react/src/components/UIShell/HeaderMenuButton.js b/packages/react/src/components/UIShell/HeaderMenuButton.js index 3d3b8aaddb0d..0da4aaedec38 100644 --- a/packages/react/src/components/UIShell/HeaderMenuButton.js +++ b/packages/react/src/components/UIShell/HeaderMenuButton.js @@ -13,7 +13,7 @@ import PropTypes from 'prop-types'; import { AriaLabelPropType } from '../../prop-types/AriaPropTypes'; import { usePrefix } from '../../internal/usePrefix'; -const HeaderMenuButton = ({ +function HeaderMenuButton({ 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, className: customClassName, @@ -23,7 +23,7 @@ const HeaderMenuButton = ({ isActive, isCollapsible, ...rest -}) => { +}) { const prefix = usePrefix(); const className = cx({ [customClassName]: !!customClassName, @@ -51,7 +51,7 @@ const HeaderMenuButton = ({ {isActive ? closeIcon : menuIcon} ); -}; +} HeaderMenuButton.propTypes = { /** diff --git a/packages/react/src/components/UIShell/HeaderName.js b/packages/react/src/components/UIShell/HeaderName.js index c2849af59e2f..90b9dce52f43 100644 --- a/packages/react/src/components/UIShell/HeaderName.js +++ b/packages/react/src/components/UIShell/HeaderName.js @@ -4,19 +4,20 @@ * This source code is licensed under the Apache-2.0 license found in the * LICENSE file in the root directory of this source tree. */ + import cx from 'classnames'; import React from 'react'; import PropTypes from 'prop-types'; import Link, { LinkPropTypes } from './Link'; import { usePrefix } from '../../internal/usePrefix'; -const HeaderName = ({ +function HeaderName({ children, className: customClassName, prefix, href, ...rest -}) => { +}) { const selectorPrefix = usePrefix(); const className = cx(`${selectorPrefix}--header__name`, customClassName); return ( @@ -32,7 +33,7 @@ const HeaderName = ({ {children} ); -}; +} HeaderName.propTypes = { /** diff --git a/packages/react/src/components/UIShell/HeaderNavigation.js b/packages/react/src/components/UIShell/HeaderNavigation.js index 109d8a54c0d3..28c3a5237291 100644 --- a/packages/react/src/components/UIShell/HeaderNavigation.js +++ b/packages/react/src/components/UIShell/HeaderNavigation.js @@ -9,80 +9,48 @@ import cx from 'classnames'; import React from 'react'; import PropTypes from 'prop-types'; import { AriaLabelPropType } from '../../prop-types/AriaPropTypes'; -import { PrefixContext } from '../../internal/usePrefix'; - -export default class HeaderNavigation extends React.Component { - static propTypes = { - /** - * Required props for accessibility label on the underlying menu - */ - ...AriaLabelPropType, - - /** - * Provide valid children of HeaderNavigation, for example `HeaderMenuItem` - * or `HeaderMenu` - */ - children: PropTypes.node, - - /** - * Optionally provide a custom class to apply to the underlying