File tree 8 files changed +32
-35
lines changed
8 files changed +32
-35
lines changed Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React from 'react';
2
2
import styled from 'styled-components' ;
3
3
import { prop , remSize } from '../../theme' ;
4
4
5
- const background = prop ( 'Panel .default.background' ) ;
5
+ const background = prop ( 'MobilePanel .default.background' ) ;
6
6
const textColor = prop ( 'primaryTextColor' ) ;
7
7
8
8
const Footer = styled . div `
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import styled from 'styled-components';
3
3
import PropTypes from 'prop-types' ;
4
4
import { prop , remSize } from '../../theme' ;
5
5
6
- const background = prop ( 'Panel .default.background' ) ;
6
+ const background = prop ( 'MobilePanel .default.background' ) ;
7
7
const textColor = prop ( 'primaryTextColor' ) ;
8
8
9
9
Original file line number Diff line number Diff line change @@ -12,14 +12,20 @@ width: ${remSize(48)};
12
12
}
13
13
` ;
14
14
15
- const IconButton = props => ( < ButtonWrapper
16
- iconBefore = { props . children }
17
- kind = { Button . kinds . inline }
18
- { ...{ ...props , children : null } }
19
- /> ) ;
15
+ const IconButton = ( props ) => {
16
+ const { icon, ...otherProps } = props ;
17
+ const Icon = icon ;
18
+
19
+ return ( < ButtonWrapper
20
+ iconBefore = { < Icon /> }
21
+ kind = { Button . kinds . inline }
22
+ focusable = "false"
23
+ { ...otherProps }
24
+ /> ) ;
25
+ } ;
20
26
21
27
IconButton . propTypes = {
22
- children : PropTypes . element . isRequired
28
+ icon : PropTypes . func . isRequired
23
29
} ;
24
30
25
31
export default IconButton ;
Original file line number Diff line number Diff line change @@ -200,7 +200,6 @@ class PreviewFrame extends React.Component {
200
200
this . addLoopProtect ( sketchDoc ) ;
201
201
sketchDoc . head . insertBefore ( consoleErrorsScript , sketchDoc . head . firstElement ) ;
202
202
203
-
204
203
return `<!DOCTYPE HTML>\n${ sketchDoc . documentElement . outerHTML } ` ;
205
204
}
206
205
@@ -384,7 +383,7 @@ PreviewFrame.propTypes = {
384
383
clearConsole : PropTypes . func . isRequired ,
385
384
cmController : PropTypes . shape ( {
386
385
getContent : PropTypes . func
387
- } )
386
+ } ) ,
388
387
} ;
389
388
390
389
PreviewFrame . defaultProps = {
Original file line number Diff line number Diff line change @@ -18,9 +18,7 @@ import { getHTMLFile } from '../reducers/files';
18
18
19
19
// Local Imports
20
20
import Editor from '../components/Editor' ;
21
- import { ExitIcon } from '../../../common/icons' ;
22
-
23
- import { PreferencesIcon , PlayIcon } from '../../../common/icons' ;
21
+ import { PreferencesIcon , PlayIcon , ExitIcon } from '../../../common/icons' ;
24
22
25
23
import IconButton from '../../../components/mobile/IconButton' ;
26
24
import Header from '../../../components/mobile/Header' ;
@@ -48,17 +46,16 @@ const MobileIDEView = (props) => {
48
46
title = { project . name }
49
47
subtitle = { selectedFile . name }
50
48
leftButton = {
51
- < IconButton to = "/mobile" aria-label = "Return to original editor" >
52
- < ExitIcon viewBox = "0 0 16 16" />
53
- </ IconButton >
49
+ < IconButton to = "/mobile" icon = { ExitIcon } aria-label = "Return to original editor" />
54
50
}
55
51
>
56
- < IconButton to = "/mobile/preferences" onClick = { ( ) => setOverlay ( 'preferences' ) } >
57
- < PreferencesIcon focusable = "false" aria-hidden = "true" />
58
- </ IconButton >
59
- < IconButton to = "/mobile/preview" onClick = { ( ) => { startSketch ( ) ; } } >
60
- < PlayIcon viewBox = "-1 -1 7 7" focusable = "false" aria-hidden = "true" />
61
- </ IconButton >
52
+ < IconButton
53
+ to = "/mobile/settings"
54
+ onClick = { ( ) => setOverlay ( 'preferences' ) }
55
+ icon = { PreferencesIcon }
56
+ aria-label = "Open preferences menu"
57
+ />
58
+ < IconButton to = "/mobile/preview" onClick = { ( ) => { startSketch ( ) ; } } icon = { PlayIcon } aria-label = "Run sketch" />
62
59
</ Header >
63
60
64
61
< IDEWrapper >
Original file line number Diff line number Diff line change @@ -22,12 +22,12 @@ const Content = styled.div`
22
22
23
23
24
24
const SettingsHeader = styled ( Header ) `
25
- background: transparent
25
+ background: transparent;
26
26
` ;
27
27
28
28
const SectionHeader = styled . h2 `
29
29
color: ${ prop ( 'primaryTextColor' ) } ;
30
- padding-top: ${ remSize ( 32 ) }
30
+ padding-top: ${ remSize ( 32 ) } ;
31
31
` ;
32
32
33
33
const SectionSubeader = styled . h3 `
@@ -161,16 +161,12 @@ const MobilePreferences = (props) => {
161
161
} ,
162
162
] ;
163
163
164
- // useEffect(() => { });
165
-
166
164
return (
167
165
< Screen fullscreen >
168
166
< section >
169
167
< SettingsHeader transparent title = "Preferences" >
170
168
171
- < IconButton to = "/mobile" aria-label = "Return to ide view" >
172
- < ExitIcon />
173
- </ IconButton >
169
+ < IconButton to = "/mobile" icon = { ExitIcon } aria-label = "Return to ide view" />
174
170
</ SettingsHeader >
175
171
< section className = "preferences" >
176
172
< Content >
Original file line number Diff line number Diff line change @@ -51,9 +51,8 @@ const MobileSketchView = (props) => {
51
51
< Screen fullscreen >
52
52
< Header
53
53
leftButton = {
54
- < IconButton to = "/mobile" aria-label = "Return to original editor" >
55
- < ExitIcon viewBox = "0 0 16 16" />
56
- </ IconButton > }
54
+ < IconButton to = "/mobile" icon = { ExitIcon } aria-label = "Return to original editor" />
55
+ }
57
56
title = { projectName }
58
57
/>
59
58
< Content >
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ export default {
89
89
default : grays . middleGray ,
90
90
hover : grays . darker
91
91
} ,
92
- Panel : {
92
+ MobilePanel : {
93
93
default : {
94
94
foreground : colors . black ,
95
95
background : grays . light ,
@@ -128,7 +128,7 @@ export default {
128
128
default : grays . middleLight ,
129
129
hover : grays . lightest
130
130
} ,
131
- Panel : {
131
+ MobilePanel : {
132
132
default : {
133
133
foreground : grays . light ,
134
134
background : grays . dark ,
@@ -167,7 +167,7 @@ export default {
167
167
default : grays . mediumLight ,
168
168
hover : colors . yellow
169
169
} ,
170
- Panel : {
170
+ MobilePanel : {
171
171
default : {
172
172
foreground : grays . light ,
173
173
background : grays . dark ,
You can’t perform that action at this time.
0 commit comments