File tree 6 files changed +10
-28
lines changed
6 files changed +10
-28
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 @@ -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 Header = styled . div `
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ width: 3rem;
12
12
` ;
13
13
14
14
const IconButton = props => ( < ButtonWrapper
15
- iconBefore = { props . children }
15
+ iconBefore = { props . element }
16
16
kind = { Button . kinds . inline }
17
- { ...{ ... props , children : null } }
17
+ { ...props }
18
18
/> ) ;
19
19
20
20
IconButton . propTypes = {
21
- children : PropTypes . element . isRequired
21
+ element : PropTypes . element . isRequired
22
22
} ;
23
23
24
24
export default IconButton ;
Original file line number Diff line number Diff line change @@ -200,12 +200,6 @@ class PreviewFrame extends React.Component {
200
200
this . addLoopProtect ( sketchDoc ) ;
201
201
sketchDoc . head . insertBefore ( consoleErrorsScript , sketchDoc . head . firstElement ) ;
202
202
203
- if ( this . props . forceFullWidth ) {
204
- const resizeScript = sketchDoc . createElement ( 'style' ) ;
205
- resizeScript . innerHTML = '.p5Canvas { width: 100% !important; height: auto !important }' ;
206
- sketchDoc . head . appendChild ( resizeScript ) ;
207
- }
208
-
209
203
return `<!DOCTYPE HTML>\n${ sketchDoc . documentElement . outerHTML } ` ;
210
204
}
211
205
@@ -390,12 +384,10 @@ PreviewFrame.propTypes = {
390
384
cmController : PropTypes . shape ( {
391
385
getContent : PropTypes . func
392
386
} ) ,
393
- forceFullWidth : PropTypes . bool
394
387
} ;
395
388
396
389
PreviewFrame . defaultProps = {
397
390
fullView : false ,
398
- forceFullWidth : false ,
399
391
cmController : { }
400
392
} ;
401
393
Original file line number Diff line number Diff line change @@ -29,16 +29,13 @@ import Header from '../../../components/mobile/Header';
29
29
import Screen from '../../../components/mobile/MobileScreen' ;
30
30
import Footer from '../../../components/mobile/Footer' ;
31
31
import IDEWrapper from '../../../components/mobile/IDEWrapper' ;
32
+ import { remSize } from '../../../theme' ;
32
33
33
34
const IconContainer = styled . div `
34
- marginLeft: 2rem ;
35
+ margin-left: ${ remSize ( 32 ) } ;
35
36
display: flex;
36
37
` ;
37
38
38
- const TitleContainer = styled . div `
39
-
40
- ` ;
41
-
42
39
const isUserOwner = ( { project, user } ) => ( project . owner && project . owner . id === user . id ) ;
43
40
44
41
const IDEViewMobile = ( props ) => {
@@ -65,12 +62,8 @@ const IDEViewMobile = (props) => {
65
62
</ div >
66
63
67
64
< IconContainer >
68
- < IconButton onClick = { ( ) => setOverlay ( 'preferences' ) } >
69
- < PreferencesIcon focusable = "false" aria-hidden = "true" />
70
- </ IconButton >
71
- < IconButton to = "/mobile/preview" onClick = { ( ) => { startSketch ( ) ; } } >
72
- < PlayIcon viewBox = "-1 -1 7 7" focusable = "false" aria-hidden = "true" />
73
- </ IconButton >
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" /> } />
74
67
</ IconContainer >
75
68
</ Header >
76
69
Original file line number Diff line number Diff line change @@ -50,9 +50,7 @@ const MobileSketchView = (props) => {
50
50
return (
51
51
< Screen >
52
52
< Header >
53
- < IconButton to = "/mobile" aria-label = "Return to original editor" >
54
- < ExitIcon viewBox = "0 0 16 16" />
55
- </ IconButton >
53
+ < IconButton to = "/mobile" element = { < ExitIcon /> } width = { 12 } height = { 12 } aria-label = "Return to original editor" />
56
54
< div style = { { marginLeft : '1rem' } } >
57
55
< h2 > { projectName } </ h2 >
58
56
< h3 > < br /> </ h3 >
@@ -67,7 +65,6 @@ const MobileSketchView = (props) => {
67
65
content = { selectedFile . content }
68
66
69
67
isPlaying
70
- forceFullWidth
71
68
isAccessibleOutputPlaying = { ide . isAccessibleOutputPlaying }
72
69
previewIsRefreshing = { ide . previewIsRefreshing }
73
70
You can’t perform that action at this time.
0 commit comments