Skip to content

Commit bdedc63

Browse files
committed
🚧 add icons to header
2 parents 0d119aa + 5aa3495 commit bdedc63

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

client/common/Icons.jsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import Google from '../images/google.svg';
77
import Plus from '../images/plus-icon.svg';
88
import Close from '../images/close.svg';
99
import DropdownArrow from '../images/down-filled-triangle.svg';
10+
import Play from '../images/triangle-arrow-right.svg';
11+
import Preferences from '../images/preferences.svg';
12+
1013

1114
// HOC that adds the right web accessibility props
1215
// https://www.scottohara.me/blog/2019/05/22/contextual-images-svgs-and-a11y.html
@@ -49,3 +52,5 @@ export const GoogleIcon = withLabel(Google);
4952
export const PlusIcon = withLabel(Plus);
5053
export const CloseIcon = withLabel(Close);
5154
export const DropdownArrowIcon = withLabel(DropdownArrow);
55+
export const PlayIcon = withLabel(Play);
56+
export const PreferencesIcon = withLabel(Preferences);

client/modules/IDE/pages/IDEViewMobile.jsx

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React from 'react';
22
import PropTypes from 'prop-types';
33
import styled from 'styled-components';
4-
// import { Link } from 'react-router';
4+
import { Link } from 'react-router';
55
import { connect } from 'react-redux';
66
import { withRouter } from 'react-router';
77
import { useState } from 'react';
@@ -21,10 +21,12 @@ import { getHTMLFile } from '../reducers/files';
2121
// Local Imports
2222
import Editor from '../components/Editor';
2323
import { prop, remSize } from '../../../theme';
24-
import CloseIcon from '../../../images/exit.svg';
24+
import { CloseIcon } from '../../../common/Icons';
25+
2526
import PreferencesIcon from '../../../images/preferences.svg';
2627
import PlayIcon from '../../../images/triangle-arrow-right.svg';
2728

29+
2830
const background = prop('Button.default.background');
2931
const textColor = prop('primaryTextColor');
3032

@@ -42,7 +44,7 @@ const Header = styled.div`
4244
display: flex;
4345
flex: 1;
4446
flex-direction: row;
45-
// justify-content: space-between;
47+
justify-content: flex-start;
4648
align-items: center;
4749
`;
4850

@@ -63,12 +65,11 @@ const Content = styled.div`
6365
margin-top: ${remSize(16)};
6466
`;
6567

66-
const Icon = styled.a`
68+
const IconButton = styled.button`
69+
width: 3rem;
6770
> svg {
68-
fill: ${textColor};
69-
color: ${textColor};
70-
margin-left: ${remSize(16)};
71-
align-items: center;
71+
width: 100%;
72+
height: auto;
7273
}
7374
`;
7475

@@ -95,26 +96,23 @@ const IDEViewMobile = (props) => {
9596
return (
9697
<Screen>
9798
<Header>
99+
<Link to="/" style={{ width: '3rem', marginRight: '1.25rem' }}>
100+
<CloseIcon viewBox="20 21 60 60" aria-hidden="true" aria-label="close header" />
101+
</Link>
98102
<div>
99103
<h2>{project.name}</h2>
100104
<h3>{selectedFile.name}</h3>
101105
</div>
102-
<div>
103-
<Icon href="/">
104-
<CloseIcon focusable="false" aria-hidden="true" />
105-
</Icon>
106-
<Icon onClick={() => setOverlay('preferences')}>
106+
107+
<div style={{ marginLeft: '2rem' }}>
108+
<IconButton onClick={() => setOverlay('preferences')}>
107109
<PreferencesIcon focusable="false" aria-hidden="true" />
108-
</Icon>
109-
<Icon onClick={() => setOverlay('runSketch')}>
110-
<PlayIcon focusable="false" aria-hidden="true" />
111-
</Icon>
110+
</IconButton>
111+
<IconButton onClick={() => setOverlay('runSketch')}>
112+
<PlayIcon viewBox="-1 -1 7 7" focusable="false" aria-hidden="true" />
113+
</IconButton>
112114
</div>
113115
</Header>
114-
{/* <div>
115-
{ [preferences, ide, editorAccessibility, project, updateLintMessage, clearLintMessage, selectedFile, updateFileContent, files, closeEditorOptions, showEditorOptions, showKeyboardShortcutModal, setUnsavedChanges, startRefreshSketch, stopSketch, expandSidebar, collapseSidebar, clearConsole, console, showRuntimeErrorWarning, hideRuntimeErrorWarning]
116-
.map(pr => <h5>{pr.toString()}</h5>) }
117-
</div> */}
118116

119117
<Content>
120118
<Editor

0 commit comments

Comments
 (0)