11import React from 'react' ;
22import PropTypes from 'prop-types' ;
3+ import { useIntl } from '@edx/frontend-platform/i18n' ;
34import {
45 ActionRow ,
56 Button ,
67 Container ,
8+ Icon ,
9+ IconButton ,
710 Nav ,
811 Row ,
912} from '@openedx/paragon' ;
10- import { Close , MenuIcon } from '@openedx/paragon/icons' ;
13+ import { Close , MenuIcon , Search } from '@openedx/paragon/icons' ;
1114
1215import CourseLockUp from './CourseLockUp' ;
1316import UserMenu from './UserMenu' ;
1417import BrandNav from './BrandNav' ;
1518import NavDropdownMenu from './NavDropdownMenu' ;
19+ import messages from './messages' ;
1620
1721const HeaderBody = ( {
1822 logo,
@@ -32,7 +36,10 @@ const HeaderBody = ({
3236 isHiddenMainMenu,
3337 mainMenuDropdowns,
3438 outlineLink,
39+ searchButtonAction,
3540} ) => {
41+ const intl = useIntl ( ) ;
42+
3643 const renderBrandNav = (
3744 < BrandNav
3845 { ...{
@@ -96,6 +103,16 @@ const HeaderBody = ({
96103 </ >
97104 ) }
98105 < ActionRow . Spacer />
106+ { searchButtonAction && (
107+ < Nav >
108+ < IconButton
109+ src = { Search }
110+ iconAs = { Icon }
111+ onClick = { searchButtonAction }
112+ aria-label = { intl . formatMessage ( messages [ 'header.label.search.nav' ] ) }
113+ />
114+ </ Nav >
115+ ) }
99116 < Nav >
100117 < UserMenu
101118 { ...{
@@ -137,6 +154,7 @@ HeaderBody.propTypes = {
137154 } ) ) ,
138155 } ) ) ,
139156 outlineLink : PropTypes . string ,
157+ searchButtonAction : PropTypes . func ,
140158} ;
141159
142160HeaderBody . defaultProps = {
@@ -155,6 +173,7 @@ HeaderBody.defaultProps = {
155173 isHiddenMainMenu : false ,
156174 mainMenuDropdowns : [ ] ,
157175 outlineLink : null ,
176+ searchButtonAction : null ,
158177} ;
159178
160179export default HeaderBody ;
0 commit comments