File tree Expand file tree Collapse file tree 3 files changed +21
-15
lines changed Expand file tree Collapse file tree 3 files changed +21
-15
lines changed Original file line number Diff line number Diff line change @@ -11,14 +11,20 @@ width: 3rem;
1111}
1212` ;
1313
14- const IconButton = props => ( < ButtonWrapper
15- iconBefore = { props . element }
16- kind = { Button . kinds . inline }
17- { ...props }
18- /> ) ;
14+ const IconButton = ( props ) => {
15+ const { icon, ...otherProps } = props ;
16+ const Icon = icon ;
17+
18+ return ( < ButtonWrapper
19+ iconBefore = { < Icon /> }
20+ kind = { Button . kinds . inline }
21+ focusable = "false"
22+ { ...otherProps }
23+ /> ) ;
24+ } ;
1925
2026IconButton . propTypes = {
21- element : PropTypes . element . isRequired
27+ icon : PropTypes . func . isRequired
2228} ;
2329
2430export default IconButton ;
Original file line number Diff line number Diff line change @@ -20,9 +20,7 @@ import { getHTMLFile } from '../reducers/files';
2020
2121// Local Imports
2222import Editor from '../components/Editor' ;
23- import { ExitIcon } from '../../../common/icons' ;
24-
25- import { PreferencesIcon , PlayIcon } from '../../../common/icons' ;
23+ import { PreferencesIcon , PlayIcon , ExitIcon } from '../../../common/icons' ;
2624
2725import IconButton from '../../../components/mobile/IconButton' ;
2826import Header from '../../../components/mobile/Header' ;
@@ -53,17 +51,19 @@ const IDEViewMobile = (props) => {
5351 return (
5452 < Screen >
5553 < Header >
56- < IconButton to = "/mobile" aria-label = "Return to original editor" >
57- < ExitIcon viewBox = "0 0 16 16" />
58- </ IconButton >
54+ < IconButton to = "/mobile" icon = { ExitIcon } aria-label = "Return to original editor" />
5955 < div style = { { marginLeft : '1rem' } } >
6056 < h2 > { project . name } </ h2 >
6157 < h3 > { selectedFile . name } </ h3 >
6258 </ div >
6359
6460 < IconContainer >
65- < IconButton onClick = { ( ) => setOverlay ( 'preferences' ) } element = { < PreferencesIcon focusable = "false" aria-hidden = "true" /> } />
66- < IconButton to = "/mobile/preview" onClick = { ( ) => { startSketch ( ) ; } } element = { < PlayIcon viewBox = "-1 -1 7 7" focusable = "false" aria-hidden = "true" /> } />
61+ < IconButton
62+ onClick = { ( ) => setOverlay ( 'preferences' ) }
63+ icon = { PreferencesIcon }
64+ aria-label = "Open preferences menu"
65+ />
66+ < IconButton to = "/mobile/preview" onClick = { ( ) => { startSketch ( ) ; } } icon = { PlayIcon } aria-label = "Run sketch" />
6767 </ IconContainer >
6868 </ Header >
6969
Original file line number Diff line number Diff line change @@ -50,7 +50,7 @@ const MobileSketchView = (props) => {
5050 return (
5151 < Screen >
5252 < Header >
53- < IconButton to = "/mobile" element = { < ExitIcon /> } width = { 12 } height = { 12 } aria-label = "Return to original editor" />
53+ < IconButton to = "/mobile" icon = { ExitIcon } aria-label = "Return to original editor" />
5454 < div style = { { marginLeft : '1rem' } } >
5555 < h2 > { projectName } </ h2 >
5656 < h3 > < br /> </ h3 >
You can’t perform that action at this time.
0 commit comments