1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
3
import { useIntl } from '@edx/frontend-platform/i18n' ;
4
+ import classNames from 'classnames' ;
4
5
import {
5
6
ActionRow ,
6
7
Button ,
@@ -37,6 +38,7 @@ const HeaderBody = ({
37
38
mainMenuDropdowns,
38
39
outlineLink,
39
40
searchButtonAction,
41
+ containerProps,
40
42
} ) => {
41
43
const intl = useIntl ( ) ;
42
44
@@ -50,8 +52,14 @@ const HeaderBody = ({
50
52
/>
51
53
) ;
52
54
55
+ const { className : containerClassName , ...restContainerProps } = containerProps || { } ;
56
+
53
57
return (
54
- < Container size = "xl" className = "px-2.5" >
58
+ < Container
59
+ size = "xl"
60
+ className = { classNames ( 'px-2.5' , containerClassName ) }
61
+ { ...restContainerProps }
62
+ >
55
63
< ActionRow as = "header" >
56
64
{ isHiddenMainMenu ? (
57
65
< Row className = "flex-nowrap ml-4" >
@@ -110,6 +118,7 @@ const HeaderBody = ({
110
118
iconAs = { Icon }
111
119
onClick = { searchButtonAction }
112
120
aria-label = { intl . formatMessage ( messages [ 'header.label.search.nav' ] ) }
121
+ alt = { intl . formatMessage ( messages [ 'header.label.search.nav' ] ) }
113
122
/>
114
123
</ Nav >
115
124
) }
@@ -147,14 +156,15 @@ HeaderBody.propTypes = {
147
156
isHiddenMainMenu : PropTypes . bool ,
148
157
mainMenuDropdowns : PropTypes . arrayOf ( PropTypes . shape ( {
149
158
id : PropTypes . string ,
150
- buttonTitle : PropTypes . string ,
159
+ buttonTitle : PropTypes . node ,
151
160
items : PropTypes . arrayOf ( PropTypes . shape ( {
152
161
href : PropTypes . string ,
153
- title : PropTypes . string ,
162
+ title : PropTypes . node ,
154
163
} ) ) ,
155
164
} ) ) ,
156
165
outlineLink : PropTypes . string ,
157
166
searchButtonAction : PropTypes . func ,
167
+ containerProps : PropTypes . shape ( Container . propTypes ) ,
158
168
} ;
159
169
160
170
HeaderBody . defaultProps = {
@@ -174,6 +184,7 @@ HeaderBody.defaultProps = {
174
184
mainMenuDropdowns : [ ] ,
175
185
outlineLink : null ,
176
186
searchButtonAction : null ,
187
+ containerProps : { } ,
177
188
} ;
178
189
179
190
export default HeaderBody ;
0 commit comments