@@ -14,6 +14,7 @@ import * as tutorial from "./tutorial";
1414
1515import ISettingsProps = pxt . editor . ISettingsProps ;
1616import { ThemeManager } from "../../react-common/components/theming/themeManager" ;
17+ import { Button } from "../../react-common/components/controls/Button" ;
1718
1819type HeaderBarView = "home" | "editor" | "tutorial" | "tutorial-tab" | "debugging" | "sandbox" | "time-machine" ;
1920const LONGPRESS_DURATION = 750 ;
@@ -107,7 +108,7 @@ export class HeaderBar extends data.Component<ISettingsProps, {}> {
107108 return < > </ > ;
108109 }
109110
110- return < div className = "ui item logo organization" role = "presentation ">
111+ return < div className = "ui item logo organization" aria-hidden = "true ">
111112 { targetTheme . organizationWideLogo || targetTheme . organizationLogo
112113 ? < img className = { `ui logo ${ view !== "home" ? "mobile hide" : "" } ` } src = { targetTheme . organizationWideLogo || targetTheme . organizationLogo } alt = { lf ( "{0} Logo" , targetTheme . organization ) } />
113114 : < span className = "name" > { targetTheme . organization } </ span > }
@@ -123,16 +124,40 @@ export class HeaderBar extends data.Component<ISettingsProps, {}> {
123124 const shouldLinkHome = pxt . shell . hasHomeScreen ( ) && view !== "home" ;
124125
125126 const role = shouldLinkHome ? "menuitem" : "presentation" ;
126- const onClickHandler = shouldLinkHome ? this . brandIconClick : undefined ;
127127
128128 // TODO: "sandbox" view components are temporary share page layout
129- return < div aria-label = { lf ( "{0} Logo" , targetTheme . boardName ) } role = { role } className = { `ui item logo brand ${ view !== "sandbox" && view !== "home" ? "mobile hide" : "" } ` } onClick = { onClickHandler } >
129+ return < div aria-hidden = { ! shouldLinkHome } role = { role } className = { `ui item logo brand ${ view !== "sandbox" && view !== "home" ? "mobile hide" : "" } ` } >
130130 { targetTheme . useTextLogo
131- ? [ < span className = "name" key = "org-name" > { targetTheme . organizationText } </ span > ,
132- < span className = "name-short" key = "org-name-short" > { targetTheme . organizationShortText || targetTheme . organizationText } </ span > ]
133- : ( targetTheme . logo || targetTheme . portraitLogo
134- ? < img className = { `ui ${ targetTheme . logoWide ? "small" : "" } logo` } src = { targetTheme . logo || targetTheme . portraitLogo } alt = { lf ( "{0} Logo" , targetTheme . boardName ) } />
135- : < span className = "name" > { targetTheme . boardName } </ span > ) }
131+ ? ( shouldLinkHome
132+ ? [ < Button className = "name menu-button" key = "org-name"
133+ onClick = { this . brandIconClick }
134+ title = { lf ( "MakeCode {0} Logo, return to home page" , targetTheme . boardName ) }
135+ ariaLabel = { lf ( "MakeCode {0} Logo, return to home page" , targetTheme . boardName ) }
136+ label = { targetTheme . organizationText } /> ,
137+ < Button className = "name-short menu-button" key = "org-name-short"
138+ onClick = { this . brandIconClick }
139+ title = { lf ( "MakeCode {0} Logo, return to home page" , targetTheme . boardName ) }
140+ ariaLabel = { lf ( "MakeCode {0} Logo, return to home page" , targetTheme . boardName ) }
141+ label = { targetTheme . organizationShortText || targetTheme . organizationText } /> ]
142+ : [ < span className = "name" key = "org-name" > { targetTheme . organizationText } </ span > ,
143+ < span className = "name-short" key = "org-name-short" > { targetTheme . organizationShortText || targetTheme . organizationText } </ span > ] )
144+ : ( shouldLinkHome
145+ ? ( targetTheme . logo || targetTheme . portraitLogo
146+ ? < Button className = "logo-button menu-button"
147+ onClick = { this . brandIconClick }
148+ title = { lf ( "MakeCode {0} Logo, return to home page" , targetTheme . boardName ) }
149+ ariaLabel = { lf ( "MakeCode {0} Logo, return to home page" , targetTheme . boardName ) }
150+ >
151+ < img className = { `ui ${ targetTheme . logoWide ? "small" : "" } logo` } src = { targetTheme . logo || targetTheme . portraitLogo } alt = { lf ( "{0} Logo" , targetTheme . boardName ) } />
152+ </ Button >
153+ : < Button className = "name menu-button"
154+ onClick = { this . brandIconClick }
155+ title = { lf ( "MakeCode {0} Logo, return to home page" , targetTheme . boardName ) }
156+ ariaLabel = { lf ( "MakeCode {0} Logo, return to home page" , targetTheme . boardName ) }
157+ label = { targetTheme . boardName } /> )
158+ : ( targetTheme . logo || targetTheme . portraitLogo
159+ ? < img className = { `ui ${ targetTheme . logoWide ? "small" : "" } logo` } src = { targetTheme . logo || targetTheme . portraitLogo } alt = { lf ( "{0} Logo" , targetTheme . boardName ) } />
160+ : < span className = "name" > { targetTheme . boardName } </ span > ) ) }
136161 </ div >
137162 }
138163
0 commit comments