Skip to content

Commit

Permalink
Onboarding and UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
paveli committed Jun 18, 2019
1 parent 19e79d5 commit 700100d
Show file tree
Hide file tree
Showing 24 changed files with 407 additions and 104 deletions.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,16 @@
"private": true,
"dependencies": {
"clipboard-polyfill": "^2.8.1",
"js-cookie": "^2.2.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
"react-hot-keys": "^1.3.1",
"react-redux": "^7.0.3",
"react-scripts": "3.0.1",
"rebass": "^3.1.1",
"redux": "^4.0.1",
"styled-components": "^4.2.0"
"styled-components": "^4.2.0",
"styled-icons": "^8.1.0"
},
"scripts": {
"start": "react-scripts start",
Expand Down
Binary file added public/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/android-chrome-384x384.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions public/browserconfig.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<browserconfig>
<msapplication>
<tile>
<square150x150logo src="/mstile-150x150.png"/>
<TileColor>#2d89ef</TileColor>
</tile>
</msapplication>
</browserconfig>
3 changes: 0 additions & 3 deletions public/circle.svg

This file was deleted.

Binary file added public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions public/flow-icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 27 additions & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,33 @@
</script>

<meta charset="utf-8" />
<link rel="shortcut icon" href="%PUBLIC_URL%/circle.svg" />

<link
rel="apple-touch-icon"
sizes="180x180"
href="%PUBLIC_URL%/apple-touch-icon.png"
/>
<link
rel="icon"
type="image/png"
sizes="32x32"
href="%PUBLIC_URL%/favicon-32x32.png"
/>
<link
rel="icon"
type="image/png"
sizes="16x16"
href="%PUBLIC_URL%/favicon-16x16.png"
/>
<link rel="manifest" href="%PUBLIC_URL%/site.webmanifest" />
<link
rel="mask-icon"
href="%PUBLIC_URL%/safari-pinned-tab.svg"
color="#5bbad5"
/>
<meta name="msapplication-TileColor" content="#2d89ef" />
<meta name="theme-color" content="#ffffff" />

<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<!--
Expand Down
Binary file added public/mstile-150x150.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/noun_Circle_1068976.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
42 changes: 42 additions & 0 deletions public/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions public/site.webmanifest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"name": "",
"short_name": "",
"icons": [
{
"src": "/android-chrome-192x192.png",
"sizes": "192x192",
"type": "image/png"
},
{
"src": "/android-chrome-384x384.png",
"sizes": "384x384",
"type": "image/png"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
3 changes: 3 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ import { Provider } from "react-redux";

import Menu from "./components/Menu";
import TextEditor from "./components/TextEditor";
import Onboarding from "./components/Onboarding";

import reducer from "./store/reducer";

import "./App.css";
Expand All @@ -15,6 +17,7 @@ function App() {
<Provider store={store}>
<Menu />
<TextEditor />
<Onboarding />
</Provider>
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/components/AutosizeInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ class AutosizeInput extends Component {
return (
<span className={this.props.className} style={wrapperStyle}>
{this.renderStyles()}
<input {...inputProps} ref={this.inputRef} />
<input {...inputProps} ref={this.inputRef} id="currentInput" />
<span ref={this.sizerRef} style={sizerStyle}>
{sizerValue}
</span>
Expand Down
49 changes: 23 additions & 26 deletions src/components/CopyToClipboard.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
import React, { Component } from "react";
import { connect } from "react-redux";
import clipboard from "clipboard-polyfill";
import styled from "styled-components";
import { Box, Flex } from "rebass";
import { Button } from "rebass";
import Hotkeys from "react-hot-keys";

import Clipboard from "../includes/Clipboard";

const Image = styled.img`
height: 2rem;
Expand All @@ -13,12 +15,6 @@ const Image = styled.img`
}
`;

const Span = styled(Box)`
&:hover {
cursor: pointer;
}
`;

function mapStateToProps(state) {
return {
text: state.text,
Expand All @@ -28,33 +24,34 @@ function mapStateToProps(state) {

class CopyToClipboard extends Component {
handleClick = () => {
clipboard.writeText(this.props.text + this.props.latestText).then(res => {
alert(
"Your text is copied to clipboard. \nPaste it to your favorite editor."
);
});
Clipboard(
this.props.text + this.props.latestText,
"Your text is copied to clipboard. \nPaste it to your favorite editor."
);
};

render() {
return (
<Flex>
{this.props.image ? (
<Box>
<Hotkeys
keyName="ctrl+c"
onKeyUp={this.handleClick}
filter={event => {
return true;
}}
>
<Button onClick={this.handleClick} bg="white" color="black" border="2">
{this.props.image ? (
<Image
src={this.props.image}
alt={this.props.alt}
onClick={this.handleClick}
/>
</Box>
) : (
""
)}
{this.props.message ? (
<Span onClick={this.handleClick}>{this.props.message}</Span>
) : (
""
)}
</Flex>
) : (
""
)}
{this.props.message ? this.props.message : ""}
</Button>
</Hotkeys>
);
}
}
Expand Down
49 changes: 14 additions & 35 deletions src/components/Menu.js
Original file line number Diff line number Diff line change
@@ -1,59 +1,38 @@
import React, { Component } from "react";
import styled from "styled-components";
import CopyToClipboard from "./CopyToClipboard";
import NewFile from "./NewFile";

const MenuWrapper = styled.div`
display: flex;
flex-direction: row;
justify-content: flex-end;
justify-content: space-between;
width: 100%;
`;

// const MenuWrapper = styled.div`
// position: absolute;
// left: 10px;
// float: right;
// width: 150px;
// height: 100%;
// z-index: 1;
// background: white;
// filter: opacity(0%);
// &:hover {
// filter: opacity(100%);
// }
// `;

const MenuItems = styled.div`
const Logo = styled.div`
align-self: flex-start;
margin: 25px;
padding: 10px;
height: 90px;
display: flex;
flex-direction: column;
justify-content: space-around;
background: #eee;
font-size: 1.5rem;
filter: opacity(30%);
width: 32px;
height: 32px;
filter: opacity(20%);
&:hover {
filter: opacity(60%);
filter: opacity(100%);
}
`;

export default class Menu extends Component {
render() {
return (
<MenuWrapper>
<MenuItems>
{/* <HeadingOne title="Distraction-free writing app">Flow</HeadingOne> */}
<NewFile image="new.svg" alt="New text" message="New" />

<CopyToClipboard
image="copy.svg"
alt="Copy text to clipboard"
message="Copy"
<Logo>
<img
width="32"
src="/flow-icon.svg"
alt="Flow Writer App"
title="Flow Writer App | CTRL+C to copy text | CRTL+N to start new text"
/>
</MenuItems>
</Logo>
</MenuWrapper>
);
}
Expand Down
40 changes: 18 additions & 22 deletions src/components/NewFile.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React, { Component } from "react";
import styled from "styled-components";
import { Box, Flex } from "rebass";
import { Button } from "rebass";
import Hotkeys from "react-hot-keys";

const Image = styled.img`
margin: 0px 10px 0px 10px;
Expand All @@ -10,33 +11,28 @@ const Image = styled.img`
}
`;

const Span = styled(Box)`
&:hover {
cursor: pointer;
}
`;

class NewFile extends Component {
handleClick = () => {
window.open("/", "_blank");
};
render() {
return (
<Flex justifyContent="left" flexDirection="row" alignItems="center">
<Box>
<Image
src={this.props.image}
alt={this.props.alt}
onClick={this.andleClick}
/>
</Box>

{this.props.message ? (
<Span onClick={this.handleClick}>{this.props.message}</Span>
) : (
""
)}
</Flex>
<Hotkeys
keyName="ctrl+n"
onKeyUp={this.handleClick}
filter={event => {
return true;
}}
>
<Button onClick={this.handleClick} bg="white" color="black" border="2">
{this.props.image ? (
<Image src={this.props.image} alt={this.props.alt} />
) : (
""
)}
{this.props.message ? this.props.message : ""}
</Button>
</Hotkeys>
);
}
}
Expand Down
Loading

0 comments on commit 700100d

Please sign in to comment.