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`
1111 background: ${ background } ;
1212 color: ${ textColor } ;
1313 padding: ${ remSize ( 12 ) } ;
14- padding-left: ${ remSize ( 32 ) } ;
15- padding-right: ${ remSize ( 32 ) } ;
14+ padding-left: ${ remSize ( 16 ) } ;
15+ padding-right: ${ remSize ( 16 ) } ;
1616 z-index: 1;
1717
1818 display: flex;
1919 flex: 1;
2020 flex-direction: row;
2121 justify-content: flex-start;
2222 align-items: center;
23+
24+ // TODO:
25+ svg {
26+ height: 2rem;
27+ }
2328` ;
2429
2530export default Header ;
Original file line number Diff line number Diff line change @@ -7,14 +7,14 @@ const ButtonWrapper = styled(Button)`
77width: 3rem;
88> svg {
99 width: 100%;
10- height: auto ;
10+ height: 100% ;
1111}
1212` ;
1313
14- const IconButton = ( { children } ) => ( < ButtonWrapper
15- aria-label = "Add to collection"
16- iconBefore = { children }
14+ const IconButton = props => ( < ButtonWrapper
15+ iconBefore = { props . children }
1716 kind = { Button . kinds . inline }
17+ { ...{ ...props , children : null } }
1818/> ) ;
1919
2020IconButton . propTypes = {
Original file line number Diff line number Diff line change @@ -30,10 +30,13 @@ import Screen from '../../../components/mobile/MobileScreen';
3030import Footer from '../../../components/mobile/Footer' ;
3131import IDEWrapper from '../../../components/mobile/IDEWrapper' ;
3232
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+
3740` ;
3841
3942const isUserOwner = ( { project, user } ) => ( project . owner && project . owner . id === user . id ) ;
@@ -53,30 +56,22 @@ const IDEViewMobile = (props) => {
5356 return (
5457 < Screen >
5558 < 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' } } >
6063 < h2 > { project . name } </ h2 >
6164 < h3 > { selectedFile . name } </ h3 >
6265 </ div >
6366
64- < div style = { { marginLeft : '2rem' , display : 'flex' } } >
67+ < IconContainer >
6568 < IconButton onClick = { ( ) => setOverlay ( 'preferences' ) } >
6669 < PreferencesIcon focusable = "false" aria-hidden = "true" />
6770 </ 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 >
8075 </ Header >
8176
8277 < IDEWrapper >
Original file line number Diff line number Diff line change @@ -5,6 +5,7 @@ import { bindActionCreators } from 'redux';
55import { connect } from 'react-redux' ;
66import styled from 'styled-components' ;
77import Header from '../../components/mobile/Header' ;
8+ import IconButton from '../../components/mobile/IconButton' ;
89import PreviewFrame from '../IDE/components/PreviewFrame' ;
910import Screen from '../../components/mobile/MobileScreen' ;
1011import * as ProjectActions from '../IDE/actions/project' ;
@@ -25,12 +26,6 @@ const Content = styled.div`
2526 margin-top: ${ remSize ( 68 ) } ;
2627` ;
2728
28- const IconLinkWrapper = styled ( Link ) `
29- width: 2rem;
30- margin-right: 1.25rem;
31- margin-left: none;
32- ` ;
33-
3429const MobileSketchView = ( props ) => {
3530 // TODO: useSelector requires react-redux ^7.1.0
3631 // const htmlFile = useSelector(state => getHTMLFile(state.files));
@@ -55,9 +50,9 @@ const MobileSketchView = (props) => {
5550 return (
5651 < Screen >
5752 < Header >
58- < IconLinkWrapper to = "/mobile" aria-label = "Return to original editor" >
53+ < IconButton to = "/mobile" aria-label = "Return to original editor" >
5954 < ExitIcon viewBox = "0 0 16 16" />
60- </ IconLinkWrapper >
55+ </ IconButton >
6156 < div >
6257 < h2 > { projectName } </ h2 >
6358 < h3 > < br /> </ h3 >
You can’t perform that action at this time.
0 commit comments