Skip to content

Add Editor component to the Mobile IDE View #1459

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Jun 18, 2020
17 changes: 6 additions & 11 deletions client/modules/IDE/pages/IDEViewMobile.jsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import PropTypes from 'prop-types';
import styled from 'styled-components';
// import { Link } from 'react-router';
import { Link } from 'react-router';
import { connect } from 'react-redux';
import { withRouter } from 'react-router';
import { useState } from 'react';
Expand All @@ -21,7 +21,7 @@ import { getHTMLFile } from '../reducers/files';
// Local Imports
import Editor from '../components/Editor';
import { prop, remSize } from '../../../theme';
import CloseIcon from '../../../images/exit.svg';
import { CloseIcon } from '../../../common/Icons';

const background = prop('Button.default.background');
const textColor = prop('primaryTextColor');
Expand All @@ -40,7 +40,7 @@ const Header = styled.div`
display: flex;
flex: 1;
flex-direction: row;
// justify-content: space-between;
justify-content: flex-start;
align-items: center;
`;

Expand Down Expand Up @@ -82,7 +82,6 @@ Screen.propTypes = {
const isUserOwner = ({ project, user }) => (project.owner && project.owner.id === user.id);

const IDEViewMobile = (props) => {
// const
const {
preferences, ide, editorAccessibility, project, updateLintMessage, clearLintMessage, selectedFile, updateFileContent, files, closeEditorOptions, showEditorOptions, showKeyboardShortcutModal, setUnsavedChanges, startRefreshSketch, stopSketch, expandSidebar, collapseSidebar, clearConsole, console, showRuntimeErrorWarning, hideRuntimeErrorWarning
} = props;
Expand All @@ -92,18 +91,14 @@ const IDEViewMobile = (props) => {
return (
<Screen>
<Header>
<Link to="/" style={{ width: '3rem', marginRight: '1.25rem' }}>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we're using styled components, I think it makes sense to not use any inline CSS like this! You also shouldn't need aria-label or aria-hidden on the CloseIcon, as aria-label should be added to the <Link>, see https://www.scottohara.me/blog/2019/05/22/contextual-images-svgs-and-a11y.html

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. Just updated this!

<CloseIcon viewBox="20 21 60 60" aria-hidden="true" aria-label="close header" />
</Link>
<div>
<h2>{project.name}</h2>
<h3>{selectedFile.name}</h3>
</div>
<Icon href="/">
<CloseIcon focusable="false" aria-hidden="true" />
</Icon>
</Header>
{/* <div>
{ [preferences, ide, editorAccessibility, project, updateLintMessage, clearLintMessage, selectedFile, updateFileContent, files, closeEditorOptions, showEditorOptions, showKeyboardShortcutModal, setUnsavedChanges, startRefreshSketch, stopSketch, expandSidebar, collapseSidebar, clearConsole, console, showRuntimeErrorWarning, hideRuntimeErrorWarning]
.map(pr => <h5>{pr.toString()}</h5>) }
</div> */}

<Content>
<Editor
Expand Down