Skip to content

Commit 9d307f0

Browse files
author
Christopher Willis-Ford
committed
show clickable 'About' button if handler is present
1 parent fde7349 commit 9d307f0

File tree

4 files changed

+25
-0
lines changed

4 files changed

+25
-0
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*.svg binary
1313

1414
# Prefer LF for most file types
15+
*.css text eol=lf
1516
*.frag text eol=lf
1617
*.htm text eol=lf
1718
*.html text eol=lf

src/components/gui/gui.jsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ const GUIComponent = props => {
8989
loading,
9090
logo,
9191
renderLogin,
92+
onClickAbout,
9293
onClickAccountNav,
9394
onCloseAccountNav,
9495
onLogOut,
@@ -219,6 +220,7 @@ const GUIComponent = props => {
219220
logo={logo}
220221
renderLogin={renderLogin}
221222
showComingSoon={showComingSoon}
223+
onClickAbout={onClickAbout}
222224
onClickAccountNav={onClickAccountNav}
223225
onClickLogo={onClickLogo}
224226
onCloseAccountNav={onCloseAccountNav}
@@ -390,6 +392,7 @@ GUIComponent.propTypes = {
390392
onActivateCostumesTab: PropTypes.func,
391393
onActivateSoundsTab: PropTypes.func,
392394
onActivateTab: PropTypes.func,
395+
onClickAbout: PropTypes.func,
393396
onClickAccountNav: PropTypes.func,
394397
onClickLogo: PropTypes.func,
395398
onCloseAccountNav: PropTypes.func,

src/components/menu-bar/menu-bar.css

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,3 +218,9 @@
218218
.mystuff > a {
219219
background-image: url("/images/mystuff.png");
220220
}
221+
222+
.about-icon {
223+
height: 1.25rem;
224+
margin: 0.5rem;
225+
vertical-align: middle;
226+
}

src/components/menu-bar/menu-bar.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ import profileIcon from './icon--profile.png';
6868
import remixIcon from './icon--remix.svg';
6969
import dropdownCaret from './dropdown-caret.svg';
7070
import languageIcon from '../language-selector/language-icon.svg';
71+
import aboutIcon from './icon--about.svg';
7172

7273
import scratchLogo from './scratch-logo.svg';
7374

@@ -310,6 +311,17 @@ class MenuBar extends React.Component {
310311
{remixMessage}
311312
</Button>
312313
);
314+
const handleClickAbout = this.props.onClickAbout;
315+
// Show the About button only if we have a handler for it (like in the desktop app)
316+
const aboutButton = handleClickAbout ? (
317+
<div className={classNames(styles.menuBarItem, styles.hoverable)}>
318+
<img
319+
className={styles.aboutIcon}
320+
onClick={handleClickAbout}
321+
src={aboutIcon}
322+
/>
323+
</div>
324+
) : null;
313325
return (
314326
<Box
315327
className={classNames(
@@ -677,6 +689,8 @@ class MenuBar extends React.Component {
677689
</React.Fragment>
678690
)}
679691
</div>
692+
693+
{aboutButton}
680694
</Box>
681695
);
682696
}
@@ -710,6 +724,7 @@ MenuBar.propTypes = {
710724
locale: PropTypes.string.isRequired,
711725
loginMenuOpen: PropTypes.bool,
712726
logo: PropTypes.string,
727+
onClickAbout: PropTypes.func,
713728
onClickAccount: PropTypes.func,
714729
onClickEdit: PropTypes.func,
715730
onClickFile: PropTypes.func,

0 commit comments

Comments
 (0)