1
1
import React from 'react' ;
2
2
import PropTypes from 'prop-types' ;
3
- import styled from 'styled-components' ;
4
- import { Link } from 'react-router' ;
5
3
import { connect } from 'react-redux' ;
6
4
import { withRouter } from 'react-router' ;
7
5
import { useState } from 'react' ;
@@ -27,16 +25,10 @@ import Header from '../../../components/mobile/Header';
27
25
import Screen from '../../../components/mobile/MobileScreen' ;
28
26
import Footer from '../../../components/mobile/Footer' ;
29
27
import IDEWrapper from '../../../components/mobile/IDEWrapper' ;
30
- import { remSize } from '../../../theme' ;
31
-
32
- const IconContainer = styled . div `
33
- margin-left: ${ remSize ( 32 ) } ;
34
- display: flex;
35
- ` ;
36
28
37
29
const isUserOwner = ( { project, user } ) => ( project . owner && project . owner . id === user . id ) ;
38
30
39
- const IDEViewMobile = ( props ) => {
31
+ const MobileIDEView = ( props ) => {
40
32
const {
41
33
preferences, ide, editorAccessibility, project, updateLintMessage, clearLintMessage,
42
34
selectedFile, updateFileContent, files,
@@ -49,22 +41,21 @@ const IDEViewMobile = (props) => {
49
41
const [ overlay , setOverlay ] = useState ( null ) ; // eslint-disable-line
50
42
51
43
return (
52
- < Screen >
53
- < Header >
54
- < IconButton to = "/mobile" icon = { ExitIcon } aria-label = "Return to original editor" />
55
- < div style = { { marginLeft : '1rem' } } >
56
- < h2 > { project . name } </ h2 >
57
- < h3 > { selectedFile . name } </ h3 >
58
- </ div >
59
-
60
- < IconContainer >
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" />
67
- </ IconContainer >
44
+ < Screen fullscreen >
45
+ < Header
46
+ title = { project . name }
47
+ subtitle = { selectedFile . name }
48
+ leftButton = {
49
+ < IconButton to = "/mobile" icon = { ExitIcon } aria-label = "Return to original editor" />
50
+ }
51
+ >
52
+ < IconButton
53
+ to = "/mobile/preferences"
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" />
68
59
</ Header >
69
60
70
61
< IDEWrapper >
@@ -109,7 +100,7 @@ const IDEViewMobile = (props) => {
109
100
} ;
110
101
111
102
112
- IDEViewMobile . propTypes = {
103
+ MobileIDEView . propTypes = {
113
104
114
105
preferences : PropTypes . shape ( {
115
106
fontSize : PropTypes . number . isRequired ,
@@ -256,4 +247,4 @@ function mapDispatchToProps(dispatch) {
256
247
}
257
248
258
249
259
- export default withRouter ( connect ( mapStateToProps , mapDispatchToProps ) ( IDEViewMobile ) ) ;
250
+ export default withRouter ( connect ( mapStateToProps , mapDispatchToProps ) ( MobileIDEView ) ) ;
0 commit comments