11import React from 'react' ;
22import PropTypes from 'prop-types' ;
33import { useIntl } from '@edx/frontend-platform/i18n' ;
4+ import classNames from 'classnames' ;
45import {
56 ActionRow ,
67 Button ,
@@ -37,6 +38,7 @@ const HeaderBody = ({
3738 mainMenuDropdowns,
3839 outlineLink,
3940 searchButtonAction,
41+ containerProps,
4042} ) => {
4143 const intl = useIntl ( ) ;
4244
@@ -50,8 +52,14 @@ const HeaderBody = ({
5052 />
5153 ) ;
5254
55+ const { className : containerClassName , ...restContainerProps } = containerProps || { } ;
56+
5357 return (
54- < Container size = "xl" className = "px-2.5" >
58+ < Container
59+ size = "xl"
60+ className = { classNames ( 'px-2.5' , containerClassName ) }
61+ { ...restContainerProps }
62+ >
5563 < ActionRow as = "header" >
5664 { isHiddenMainMenu ? (
5765 < Row className = "flex-nowrap ml-4" >
@@ -110,6 +118,7 @@ const HeaderBody = ({
110118 iconAs = { Icon }
111119 onClick = { searchButtonAction }
112120 aria-label = { intl . formatMessage ( messages [ 'header.label.search.nav' ] ) }
121+ alt = { intl . formatMessage ( messages [ 'header.label.search.nav' ] ) }
113122 />
114123 </ Nav >
115124 ) }
@@ -147,14 +156,15 @@ HeaderBody.propTypes = {
147156 isHiddenMainMenu : PropTypes . bool ,
148157 mainMenuDropdowns : PropTypes . arrayOf ( PropTypes . shape ( {
149158 id : PropTypes . string ,
150- buttonTitle : PropTypes . string ,
159+ buttonTitle : PropTypes . node ,
151160 items : PropTypes . arrayOf ( PropTypes . shape ( {
152161 href : PropTypes . string ,
153- title : PropTypes . string ,
162+ title : PropTypes . node ,
154163 } ) ) ,
155164 } ) ) ,
156165 outlineLink : PropTypes . string ,
157166 searchButtonAction : PropTypes . func ,
167+ containerProps : PropTypes . shape ( Container . propTypes ) ,
158168} ;
159169
160170HeaderBody . defaultProps = {
@@ -174,6 +184,7 @@ HeaderBody.defaultProps = {
174184 mainMenuDropdowns : [ ] ,
175185 outlineLink : null ,
176186 searchButtonAction : null ,
187+ containerProps : { } ,
177188} ;
178189
179190export default HeaderBody ;
0 commit comments