File tree Expand file tree Collapse file tree 6 files changed +10
-28
lines changed Expand file tree Collapse file tree 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';
22import styled from 'styled-components' ;
33import { prop , remSize } from '../../theme' ;
44
5- const background = prop ( 'Panel .default.background' ) ;
5+ const background = prop ( 'MobilePanel .default.background' ) ;
66const textColor = prop ( 'primaryTextColor' ) ;
77
88const Footer = styled . div `
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import React from 'react';
22import styled from 'styled-components' ;
33import { prop , remSize } from '../../theme' ;
44
5- const background = prop ( 'Panel .default.background' ) ;
5+ const background = prop ( 'MobilePanel .default.background' ) ;
66const textColor = prop ( 'primaryTextColor' ) ;
77
88const Header = styled . div `
Original file line number Diff line number Diff line change @@ -12,13 +12,13 @@ width: 3rem;
1212` ;
1313
1414const IconButton = props => ( < ButtonWrapper
15- iconBefore = { props . children }
15+ iconBefore = { props . element }
1616 kind = { Button . kinds . inline }
17- { ...{ ... props , children : null } }
17+ { ...props }
1818/> ) ;
1919
2020IconButton . propTypes = {
21- children : PropTypes . element . isRequired
21+ element : PropTypes . element . isRequired
2222} ;
2323
2424export default IconButton ;
Original file line number Diff line number Diff line change @@ -200,12 +200,6 @@ class PreviewFrame extends React.Component {
200200 this . addLoopProtect ( sketchDoc ) ;
201201 sketchDoc . head . insertBefore ( consoleErrorsScript , sketchDoc . head . firstElement ) ;
202202
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-
209203 return `<!DOCTYPE HTML>\n${ sketchDoc . documentElement . outerHTML } ` ;
210204 }
211205
@@ -390,12 +384,10 @@ PreviewFrame.propTypes = {
390384 cmController : PropTypes . shape ( {
391385 getContent : PropTypes . func
392386 } ) ,
393- forceFullWidth : PropTypes . bool
394387} ;
395388
396389PreviewFrame . defaultProps = {
397390 fullView : false ,
398- forceFullWidth : false ,
399391 cmController : { }
400392} ;
401393
Original file line number Diff line number Diff line change @@ -29,16 +29,13 @@ import Header from '../../../components/mobile/Header';
2929import Screen from '../../../components/mobile/MobileScreen' ;
3030import Footer from '../../../components/mobile/Footer' ;
3131import IDEWrapper from '../../../components/mobile/IDEWrapper' ;
32+ import { remSize } from '../../../theme' ;
3233
3334const IconContainer = styled . div `
34- marginLeft: 2rem ;
35+ margin-left: ${ remSize ( 32 ) } ;
3536 display: flex;
3637` ;
3738
38- const TitleContainer = styled . div `
39-
40- ` ;
41-
4239const isUserOwner = ( { project, user } ) => ( project . owner && project . owner . id === user . id ) ;
4340
4441const IDEViewMobile = ( props ) => {
@@ -65,12 +62,8 @@ const IDEViewMobile = (props) => {
6562 </ div >
6663
6764 < 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" /> } />
7467 </ IconContainer >
7568 </ Header >
7669
Original file line number Diff line number Diff line change @@ -50,9 +50,7 @@ const MobileSketchView = (props) => {
5050 return (
5151 < Screen >
5252 < 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" />
5654 < div style = { { marginLeft : '1rem' } } >
5755 < h2 > { projectName } </ h2 >
5856 < h3 > < br /> </ h3 >
@@ -67,7 +65,6 @@ const MobileSketchView = (props) => {
6765 content = { selectedFile . content }
6866
6967 isPlaying
70- forceFullWidth
7168 isAccessibleOutputPlaying = { ide . isAccessibleOutputPlaying }
7269 previewIsRefreshing = { ide . previewIsRefreshing }
7370
You can’t perform that action at this time.
0 commit comments