File tree Expand file tree Collapse file tree 4 files changed +30
-35
lines changed Expand file tree Collapse file tree 4 files changed +30
-35
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,20 @@ const Header = styled.div`
11
11
background: ${ background } ;
12
12
color: ${ textColor } ;
13
13
padding: ${ remSize ( 12 ) } ;
14
- padding-left: ${ remSize ( 32 ) } ;
15
- padding-right: ${ remSize ( 32 ) } ;
14
+ padding-left: ${ remSize ( 16 ) } ;
15
+ padding-right: ${ remSize ( 16 ) } ;
16
16
z-index: 1;
17
17
18
18
display: flex;
19
19
flex: 1;
20
20
flex-direction: row;
21
21
justify-content: flex-start;
22
22
align-items: center;
23
+
24
+ // TODO:
25
+ svg {
26
+ height: 2rem;
27
+ }
23
28
` ;
24
29
25
30
export default Header ;
Original file line number Diff line number Diff line change @@ -7,14 +7,14 @@ const ButtonWrapper = styled(Button)`
7
7
width: 3rem;
8
8
> svg {
9
9
width: 100%;
10
- height: auto ;
10
+ height: 100% ;
11
11
}
12
12
` ;
13
13
14
- const IconButton = ( { children } ) => ( < ButtonWrapper
15
- aria-label = "Add to collection"
16
- iconBefore = { children }
14
+ const IconButton = props => ( < ButtonWrapper
15
+ iconBefore = { props . children }
17
16
kind = { Button . kinds . inline }
17
+ { ...{ ...props , children : null } }
18
18
/> ) ;
19
19
20
20
IconButton . propTypes = {
Original file line number Diff line number Diff line change @@ -30,10 +30,13 @@ import Screen from '../../../components/mobile/MobileScreen';
30
30
import Footer from '../../../components/mobile/Footer' ;
31
31
import IDEWrapper from '../../../components/mobile/IDEWrapper' ;
32
32
33
- const IconLinkWrapper = styled ( Link ) `
34
- width: 3rem;
35
- margin-right: 1.25rem;
36
- margin-left: none;
33
+ const IconContainer = styled . div `
34
+ marginLeft: 2rem;
35
+ display: flex;
36
+ ` ;
37
+
38
+ const TitleContainer = styled . div `
39
+
37
40
` ;
38
41
39
42
const isUserOwner = ( { project, user } ) => ( project . owner && project . owner . id === user . id ) ;
@@ -53,30 +56,22 @@ const IDEViewMobile = (props) => {
53
56
return (
54
57
< Screen >
55
58
< Header >
56
- < IconLinkWrapper to = "/" aria-label = "Return to original editor" >
57
- < ExitIcon />
58
- </ IconLinkWrapper >
59
- < div >
59
+ < IconButton to = "/mobile " aria-label = "Return to original editor" >
60
+ < ExitIcon viewBox = "0 0 16 16" />
61
+ </ IconButton >
62
+ < div style = { { marginLeft : '1rem' } } >
60
63
< h2 > { project . name } </ h2 >
61
64
< h3 > { selectedFile . name } </ h3 >
62
65
</ div >
63
66
64
- < div style = { { marginLeft : '2rem' , display : 'flex' } } >
67
+ < IconContainer >
65
68
< IconButton onClick = { ( ) => setOverlay ( 'preferences' ) } >
66
69
< PreferencesIcon focusable = "false" aria-hidden = "true" />
67
70
</ IconButton >
68
- < Link
69
- to = "/mobile/preview"
70
- onClick = { ( ) => {
71
- // alert('starting sketch');
72
- startSketch ( ) ;
73
- } }
74
- >
75
- < IconButton >
76
- < PlayIcon viewBox = "-1 -1 7 7" focusable = "false" aria-hidden = "true" />
77
- </ IconButton >
78
- </ Link >
79
- </ div >
71
+ < IconButton to = "/mobile/preview" onClick = { ( ) => { startSketch ( ) ; } } >
72
+ < PlayIcon viewBox = "-1 -1 7 7" focusable = "false" aria-hidden = "true" />
73
+ </ IconButton >
74
+ </ IconContainer >
80
75
</ Header >
81
76
82
77
< IDEWrapper >
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { bindActionCreators } from 'redux';
5
5
import { connect } from 'react-redux' ;
6
6
import styled from 'styled-components' ;
7
7
import Header from '../../components/mobile/Header' ;
8
+ import IconButton from '../../components/mobile/IconButton' ;
8
9
import PreviewFrame from '../IDE/components/PreviewFrame' ;
9
10
import Screen from '../../components/mobile/MobileScreen' ;
10
11
import * as ProjectActions from '../IDE/actions/project' ;
@@ -25,12 +26,6 @@ const Content = styled.div`
25
26
margin-top: ${ remSize ( 68 ) } ;
26
27
` ;
27
28
28
- const IconLinkWrapper = styled ( Link ) `
29
- width: 2rem;
30
- margin-right: 1.25rem;
31
- margin-left: none;
32
- ` ;
33
-
34
29
const MobileSketchView = ( props ) => {
35
30
// TODO: useSelector requires react-redux ^7.1.0
36
31
// const htmlFile = useSelector(state => getHTMLFile(state.files));
@@ -55,9 +50,9 @@ const MobileSketchView = (props) => {
55
50
return (
56
51
< Screen >
57
52
< Header >
58
- < IconLinkWrapper to = "/mobile" aria-label = "Return to original editor" >
53
+ < IconButton to = "/mobile" aria-label = "Return to original editor" >
59
54
< ExitIcon viewBox = "0 0 16 16" />
60
- </ IconLinkWrapper >
55
+ </ IconButton >
61
56
< div >
62
57
< h2 > { projectName } </ h2 >
63
58
< h3 > < br /> </ h3 >
You can’t perform that action at this time.
0 commit comments