File tree Expand file tree Collapse file tree 2 files changed +6
-9
lines changed
Expand file tree Collapse file tree 2 files changed +6
-9
lines changed Original file line number Diff line number Diff line change 44 */
55
66import * as React from 'react' ;
7- import { injectIntl , IntlShape } from 'react-intl' ;
7+ import { useIntl } from 'react-intl' ;
88import Logo from './Logo' ;
99import messages from '../messages' ;
1010import { VIEW_FOLDER , VIEW_SEARCH } from '../../../constants' ;
@@ -13,7 +13,6 @@ import { View } from '../../../common/types/core';
1313import './Header.scss' ;
1414
1515interface HeaderProps {
16- intl : IntlShape ;
1716 isHeaderLogoVisible ?: boolean ;
1817 isSmall : boolean ;
1918 logoUrl ?: string ;
@@ -22,17 +21,15 @@ interface HeaderProps {
2221 view : View ;
2322}
2423
25- // eslint-disable-next-line react/prop-types
2624const Header = ( {
2725 isHeaderLogoVisible = true ,
2826 view,
2927 isSmall,
3028 searchQuery,
3129 onSearch,
3230 logoUrl,
33- intl,
3431} : HeaderProps ) : JSX . Element => {
35- const { formatMessage } = intl ;
32+ const { formatMessage } = useIntl ( ) ;
3633 const search = ( { currentTarget } : { currentTarget : HTMLInputElement } ) : void => onSearch ( currentTarget . value ) ;
3734 const searchMessage = formatMessage ( messages . searchPlaceholder ) ;
3835 const isFolder = view === VIEW_FOLDER ;
@@ -57,4 +54,4 @@ const Header = ({
5754} ;
5855
5956export { Header as HeaderBase } ;
60- export default injectIntl ( Header ) ;
57+ export default Header ;
Original file line number Diff line number Diff line change @@ -16,14 +16,14 @@ interface LogoProps {
1616
1717function getLogo ( url ?: string ) : React . ReactNode {
1818 if ( url === 'box' ) {
19- return < IconLogo /> ;
19+ return < IconLogo aria-label = "Box logo" role = "img" /> ;
2020 }
2121 if ( typeof url === 'string' ) {
22- return < img alt = "" className = "be-logo-custom" src = { url } /> ;
22+ return < img alt = "Logo" aria-label = "Custom logo " className = "be-logo-custom" src = { url } /> ;
2323 }
2424
2525 return (
26- < div className = "be-logo-placeholder" >
26+ < div className = "be-logo-placeholder" role = "img" aria-label = "Logo placeholder" >
2727 < FormattedMessage { ...messages . logo } />
2828 </ div >
2929 ) ;
You can’t perform that action at this time.
0 commit comments