This react component will replace lesspass-pure. We are migrating from vue to react. It will looks like the react native mobile app.pull/364/head
@@ -26,7 +26,7 @@ | |||
"copy-webpack-plugin": "4.6.0", | |||
"cross-env": "5.2.0", | |||
"css-loader": "1.0.1", | |||
"eslint": "5.9.0", | |||
"eslint": "5.6.0", | |||
"eslint-config-airbnb-base": "13.1.0", | |||
"eslint-config-prettier": "3.3.0", | |||
"eslint-plugin-import": "2.14.0", | |||
@@ -54,7 +54,7 @@ | |||
"vue-polyglot-utils": "0.1.1", | |||
"vue-template-compiler": "2.5.17", | |||
"walk": "2.3.14", | |||
"webpack": "4.27.0", | |||
"webpack-dev-server": "3.1.10" | |||
"webpack": "4.19.1", | |||
"webpack-dev-server": "3.1.9" | |||
} | |||
} |
@@ -551,11 +551,11 @@ | |||
prop-types "^15.6.0" | |||
"@react-navigation/core@^3.0.0": | |||
version "3.0.1" | |||
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-3.0.1.tgz#9c513c65ae64aa8dee2777f66f547d488905140b" | |||
integrity sha512-bJgQHGhtczCmnfIibKuOjgSucLb6rJiz/EbpgqpCHLWg64D94OVEig7uQesmynCiaas1MN1FDSX2hrh2IB3kVw== | |||
version "3.0.2" | |||
resolved "https://registry.yarnpkg.com/@react-navigation/core/-/core-3.0.2.tgz#8631801533a27d034a3b8421dfd0510a9f27dcf3" | |||
integrity sha512-E0ETZJUuJRHvjtb0f0U416NcDxt9T5HvRLxXu5K4DNxtmjpOfkT9Sh+Q309/zrCwSkHY85ZpGKvewZTSGI7Q1Q== | |||
dependencies: | |||
create-react-context "^0.2.3" | |||
create-react-context "0.2.2" | |||
hoist-non-react-statics "^3.0.1" | |||
path-to-regexp "^1.7.0" | |||
query-string "^6.2.0" | |||
@@ -1704,9 +1704,9 @@ core-js@^1.0.0: | |||
integrity sha1-ZSKUwUZR2yj6k70tX/KYOk8IxjY= | |||
core-js@^2.2.2, core-js@^2.4.0, core-js@^2.4.1, core-js@^2.5.0, core-js@^2.5.3: | |||
version "2.5.7" | |||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.5.7.tgz#f972608ff0cead68b841a16a932d0b183791814e" | |||
integrity sha512-RszJCAxg/PP6uzXVXL6BsxSXx/B05oJAQ2vkJRjyjrEcNVycaqOmNb5OTxZPE3xa5gwZduqza6L9JOCenh/Ecw== | |||
version "2.6.0" | |||
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.6.0.tgz#1e30793e9ee5782b307e37ffa22da0eacddd84d4" | |||
integrity sha512-kLRC6ncVpuEW/1kwrOXYX6KQASCVtrh1gQr/UiaVgFlf9WE5Vp+lNe5+h3LuMr5PAucWnnEXwH0nQHRH/gpGtw== | |||
core-util-is@~1.0.0: | |||
version "1.0.2" | |||
@@ -1722,7 +1722,15 @@ create-react-class@^15.6.3: | |||
loose-envify "^1.3.1" | |||
object-assign "^4.1.1" | |||
create-react-context@^0.2.1, create-react-context@^0.2.2, create-react-context@^0.2.3: | |||
create-react-context@0.2.2: | |||
version "0.2.2" | |||
resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.2.tgz#9836542f9aaa22868cd7d4a6f82667df38019dca" | |||
integrity sha512-KkpaLARMhsTsgp0d2NA/R94F/eDLbhXERdIq3LvX2biCAXcDvHYoOqHfWCHf1+OLj+HKBotLG3KqaOOf+C1C+A== | |||
dependencies: | |||
fbjs "^0.8.0" | |||
gud "^1.0.0" | |||
create-react-context@^0.2.1, create-react-context@^0.2.2: | |||
version "0.2.3" | |||
resolved "https://registry.yarnpkg.com/create-react-context/-/create-react-context-0.2.3.tgz#9ec140a6914a22ef04b8b09b7771de89567cb6f3" | |||
integrity sha512-CQBmD0+QGgTaxDL3OX1IDXYqjkp2It4RIbcb99jS6AEg27Ga+a9G3JtK6SIu0HBwPLZlmwt9F7UwWA4Bn92Rag== | |||
@@ -3293,9 +3301,9 @@ minipass@^2.2.1, minipass@^2.3.4: | |||
yallist "^3.0.0" | |||
minizlib@^1.1.1: | |||
version "1.1.1" | |||
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.1.1.tgz#6734acc045a46e61d596a43bb9d9cd326e19cc42" | |||
integrity sha512-TrfjCjk4jLhcJyGMYymBH6oTXcWjYbUAXTHDbtnWHjZC25h0cdajHuPE1zxb4DVmu8crfh+HwH/WMuyLG0nHBg== | |||
version "1.2.1" | |||
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.2.1.tgz#dd27ea6136243c7c880684e8672bb3a45fd9b614" | |||
integrity sha512-7+4oTUOWKg7AuL3vloEWekXY2/D20cevzsrNT2kGWm+39J9hGTCBv8VI5Pm5lXZ/o3/mdR4f8rflAPhnQb8mPA== | |||
dependencies: | |||
minipass "^2.2.1" | |||
@@ -3861,7 +3869,7 @@ react-lifecycles-compat@^3.0.4: | |||
resolved "https://registry.yarnpkg.com/react-lifecycles-compat/-/react-lifecycles-compat-3.0.4.tgz#4f1a273afdfc8f3488a8c516bfda78f872352362" | |||
integrity sha512-fBASbA6LnOU9dOU2eW7aQ8xmYBSXUIWr+UmF9b1efZBazGNO+rcXT/icdKnYm2pTwcRylVUYwW7H1PHfLekVzA== | |||
react-native-gesture-handler@1.0.10, react-native-gesture-handler@^1.0.0: | |||
react-native-gesture-handler@1.0.10: | |||
version "1.0.10" | |||
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.0.10.tgz#160e55e4886471931b7f7d52e22d94007540ab83" | |||
integrity sha512-GNVZ+rbwfi147qOxIvWyfHcTswr+CRT/bSy/Gr5Dz17/tWmomf9D6tGr1yJhyW8IhEZ307KLBWRCXLBM9Q2YQg== | |||
@@ -3870,6 +3878,15 @@ react-native-gesture-handler@1.0.10, react-native-gesture-handler@^1.0.0: | |||
invariant "^2.2.2" | |||
prop-types "^15.5.10" | |||
react-native-gesture-handler@^1.0.0: | |||
version "1.0.12" | |||
resolved "https://registry.yarnpkg.com/react-native-gesture-handler/-/react-native-gesture-handler-1.0.12.tgz#99a22f90212df299245357dbd3a9a01c788f310b" | |||
integrity sha512-Qp5FjRmqUFeCevSu2IYQG1Xw+YXZ9YOzqze/ZxaIvWzYAoKsRchlgHhNoxvCqElp/befrnVFIjAEQyUxcmBKJw== | |||
dependencies: | |||
hoist-non-react-statics "^2.3.1" | |||
invariant "^2.2.2" | |||
prop-types "^15.5.10" | |||
react-native-keychain@3.0.0: | |||
version "3.0.0" | |||
resolved "https://registry.yarnpkg.com/react-native-keychain/-/react-native-keychain-3.0.0.tgz#29da1dfa43c2581f76bf9420914fd38a1558cf18" | |||
@@ -3977,9 +3994,9 @@ react-native@0.56.1: | |||
yargs "^9.0.0" | |||
react-navigation-drawer@^1.0.3: | |||
version "1.0.4" | |||
resolved "https://registry.yarnpkg.com/react-navigation-drawer/-/react-navigation-drawer-1.0.4.tgz#41fbf71db108b3183e0c0351bf19ffee0aea10e7" | |||
integrity sha512-P+3FgiYX2iQIkXeYCg7hOfg7u9fYBLWjqb1k6ILxML9VBimPXXM+87/lnIsfkZVOm4FIoH/ZAofbkPa7rYeJcQ== | |||
version "1.0.5" | |||
resolved "https://registry.yarnpkg.com/react-navigation-drawer/-/react-navigation-drawer-1.0.5.tgz#d8cc71bd1779186261f3c3754b11f29aa98bd4f5" | |||
integrity sha512-WeGrXFn84R75IAt3ndDfkHw9FNvPsi4JPGO1iopqUoA/2tMPA6WJbhuE3dqmmEu3TZRjI+2LatCgpx00tT1kiQ== | |||
dependencies: | |||
react-native-tab-view "^1.2.0" | |||
@@ -3993,9 +4010,9 @@ react-navigation-material-bottom-tabs@1.0.0: | |||
react-navigation-tabs "1.0.0" | |||
react-navigation-stack@^1.0.2: | |||
version "1.0.4" | |||
resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-1.0.4.tgz#ec97ca34942e1001b6633690e26e33f86f26e0c3" | |||
integrity sha512-wMLJkv1kUVXqdLp76n54mCLxp7slI7trLhprz0wTrwcunDjosQjE0AtyuPBS4o+nzM81CD5XGSeVkjyDblebgA== | |||
version "1.0.5" | |||
resolved "https://registry.yarnpkg.com/react-navigation-stack/-/react-navigation-stack-1.0.5.tgz#8aad306a069b080f32fcd48a11bfd6abfeb0a6b9" | |||
integrity sha512-X/rsSKD+dvfuDitmAJvqelRjD9hmA5SP7uq7F6CncaUX6M2BLb8Q39KBxcjsBMLVHOSrfOoUq3HciwN1xSBxvg== | |||
react-navigation-tabs@1.0.0: | |||
version "1.0.0" | |||
@@ -4177,9 +4194,9 @@ regexpu-core@^2.0.0: | |||
regjsparser "^0.1.4" | |||
regexpu-core@^4.1.3: | |||
version "4.3.0" | |||
resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.3.0.tgz#256cd550eadea9c9f37933c8a60ca966c8c1bc95" | |||
integrity sha512-pniBuFHJMDy9P8jnXGBvfLQsQqzGsZuhT0KezuTWn1vMdJxuhsHauNdIvzMsiORmYPgLbPGwWbq3czCKa5RsWA== | |||
version "4.4.0" | |||
resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-4.4.0.tgz#8d43e0d1266883969720345e70c275ee0aec0d32" | |||
integrity sha512-eDDWElbwwI3K0Lo6CqbQbA6FwgtCz4kYTarrri1okfkRLZAqstU+B3voZBCjg8Fl6iq0gXrJG6MvRgLthfvgOA== | |||
dependencies: | |||
regenerate "^1.4.0" | |||
regenerate-unicode-properties "^7.0.0" | |||
@@ -4544,9 +4561,9 @@ source-map@~0.6.1: | |||
integrity sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g== | |||
spdx-correct@^3.0.0: | |||
version "3.0.2" | |||
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.0.2.tgz#19bb409e91b47b1ad54159243f7312a858db3c2e" | |||
integrity sha512-q9hedtzyXHr5S0A1vEPoK/7l8NpfkFYTq6iCY+Pno2ZbdZR6WexZFtqeVGkGxW3TEJMN914Z55EnAGMmenlIQQ== | |||
version "3.1.0" | |||
resolved "https://registry.yarnpkg.com/spdx-correct/-/spdx-correct-3.1.0.tgz#fb83e504445268f154b074e218c87c003cd31df4" | |||
integrity sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q== | |||
dependencies: | |||
spdx-expression-parse "^3.0.0" | |||
spdx-license-ids "^3.0.0" | |||
@@ -0,0 +1,23 @@ | |||
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files. | |||
# dependencies | |||
/node_modules | |||
/.pnp | |||
.pnp.js | |||
# testing | |||
/coverage | |||
# production | |||
/build | |||
# misc | |||
.DS_Store | |||
.env.local | |||
.env.development.local | |||
.env.test.local | |||
.env.production.local | |||
npm-debug.log* | |||
yarn-debug.log* | |||
yarn-error.log* |
@@ -0,0 +1,44 @@ | |||
This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app). | |||
## Available Scripts | |||
In the project directory, you can run: | |||
### `npm start` | |||
Runs the app in the development mode.<br> | |||
Open [http://localhost:3000](http://localhost:3000) to view it in the browser. | |||
The page will reload if you make edits.<br> | |||
You will also see any lint errors in the console. | |||
### `npm test` | |||
Launches the test runner in the interactive watch mode.<br> | |||
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information. | |||
### `npm run build` | |||
Builds the app for production to the `build` folder.<br> | |||
It correctly bundles React in production mode and optimizes the build for the best performance. | |||
The build is minified and the filenames include the hashes.<br> | |||
Your app is ready to be deployed! | |||
See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information. | |||
### `npm run eject` | |||
**Note: this is a one-way operation. Once you `eject`, you can’t go back!** | |||
If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project. | |||
Instead, it will copy all the configuration files and the transitive dependencies (Webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own. | |||
You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it. | |||
## Learn More | |||
You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started). | |||
To learn React, check out the [React documentation](https://reactjs.org/). |
@@ -0,0 +1,28 @@ | |||
{ | |||
"name": "lesspass-web-component", | |||
"version": "1.0.0", | |||
"dependencies": { | |||
"@fortawesome/fontawesome-svg-core": "^1.2.10", | |||
"@fortawesome/free-solid-svg-icons": "^5.6.1", | |||
"@fortawesome/react-fontawesome": "^0.1.3", | |||
"react": "^16.6.3", | |||
"react-dom": "^16.6.3", | |||
"react-scripts": "2.1.1", | |||
"styled-components": "^4.1.2" | |||
}, | |||
"scripts": { | |||
"start": "react-scripts start", | |||
"build": "react-scripts build", | |||
"test": "react-scripts test", | |||
"eject": "react-scripts eject" | |||
}, | |||
"eslintConfig": { | |||
"extends": "react-app" | |||
}, | |||
"browserslist": [ | |||
">0.2%", | |||
"not dead", | |||
"not ie <= 11", | |||
"not op_mini all" | |||
] | |||
} |
@@ -0,0 +1,40 @@ | |||
<!DOCTYPE html> | |||
<html lang="en"> | |||
<head> | |||
<meta charset="utf-8"> | |||
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico"> | |||
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> | |||
<meta name="theme-color" content="#000000"> | |||
<!-- | |||
manifest.json provides metadata used when your web app is added to the | |||
homescreen on Android. See https://developers.google.com/web/fundamentals/web-app-manifest/ | |||
--> | |||
<link rel="manifest" href="%PUBLIC_URL%/manifest.json"> | |||
<!-- | |||
Notice the use of %PUBLIC_URL% in the tags above. | |||
It will be replaced with the URL of the `public` folder during the build. | |||
Only files inside the `public` folder can be referenced from the HTML. | |||
Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will | |||
work correctly both with client-side routing and a non-root public URL. | |||
Learn how to configure a non-root public URL by running `npm run build`. | |||
--> | |||
<title>React App</title> | |||
</head> | |||
<body> | |||
<noscript> | |||
You need to enable JavaScript to run this app. | |||
</noscript> | |||
<div id="root"></div> | |||
<!-- | |||
This HTML file is a template. | |||
If you open it directly in the browser, you will see an empty page. | |||
You can add webfonts, meta tags, or analytics to this file. | |||
The build step will place the bundled scripts into the <body> tag. | |||
To begin the development, run `npm start` or `yarn start`. | |||
To create a production bundle, use `npm run build` or `yarn build`. | |||
--> | |||
</body> | |||
</html> |
@@ -0,0 +1,15 @@ | |||
{ | |||
"short_name": "React App", | |||
"name": "Create React App Sample", | |||
"icons": [ | |||
{ | |||
"src": "favicon.ico", | |||
"sizes": "64x64 32x32 24x24 16x16", | |||
"type": "image/x-icon" | |||
} | |||
], | |||
"start_url": ".", | |||
"display": "standalone", | |||
"theme_color": "#000000", | |||
"background_color": "#ffffff" | |||
} |
@@ -0,0 +1,307 @@ | |||
import React, { Component } from "react"; | |||
import styled, { createGlobalStyle } from "styled-components"; | |||
import Logo from "./logo.png"; | |||
import { library } from "@fortawesome/fontawesome-svg-core"; | |||
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; | |||
import { | |||
faCogs, | |||
faQuestion, | |||
faUserSecret | |||
} from "@fortawesome/free-solid-svg-icons"; | |||
library.add(faCogs); | |||
library.add(faQuestion); | |||
library.add(faUserSecret); | |||
const GlobalStyle = createGlobalStyle` | |||
html { | |||
box-sizing: border-box; | |||
background-color: #024379; | |||
} | |||
*, *:before, *:after { | |||
box-sizing: inherit; | |||
} | |||
input[type=number]::-webkit-outer-spin-button, | |||
input[type=number]::-webkit-inner-spin-button { | |||
-webkit-appearance: none; | |||
margin: 0; | |||
} | |||
input[type=number] { | |||
-moz-appearance:textfield; | |||
} | |||
`; | |||
const MainContent = styled.div` | |||
background-color: #333333; | |||
display: flex; | |||
flex-direction: column; | |||
width: 100%; | |||
max-width: 320px; | |||
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, | |||
Helvetica Neue, Arial, sans-serif; | |||
color: #eeeeee; | |||
box-sizing: border-box; | |||
`; | |||
const Header = styled.div` | |||
background-color: #333333; | |||
display: flex; | |||
justify-content: center; | |||
padding: 1em 0; | |||
`; | |||
const HeaderImg = styled.img` | |||
width: 180px; | |||
height: 39px; | |||
`; | |||
const Content = styled.div` | |||
background-color: #fff; | |||
display: flex; | |||
flex-direction: column; | |||
padding: 1em; | |||
`; | |||
const Footer = styled.div` | |||
display: flex; | |||
justify-content: space-around; | |||
`; | |||
const FooterItem = styled.a` | |||
padding: 0.5em; | |||
padding-top: 0.7em; | |||
width: 75px; | |||
text-align: center; | |||
display: flex; | |||
flex-direction: column; | |||
justify-content: center; | |||
align-items: center; | |||
cursor: pointer; | |||
color: ${props => (props.active ? "#eee" : "#aaa")}; | |||
`; | |||
const FooterIcon = styled(FontAwesomeIcon)` | |||
font-size: 1em; | |||
margin-bottom: 0.5em; | |||
`; | |||
const FooterText = styled.div` | |||
font-size: 0.8em; | |||
`; | |||
const InputWrapper = styled.div` | |||
position: relative; | |||
margin-bottom: 0.5em; | |||
input { | |||
width: 100%; | |||
padding: 1em 0.5em; | |||
outline: none; | |||
border: 1px solid #dddddd; | |||
border-radius: 3px; | |||
} | |||
input:focus { | |||
border-color: #333333; | |||
} | |||
label { | |||
background-color: #ffffff; | |||
color: #333333; | |||
padding: 0 0.5em; | |||
position: absolute; | |||
top: -0.5em; | |||
font-size: 0.8em; | |||
left: 10px; | |||
} | |||
`; | |||
class Input extends Component { | |||
state = { | |||
focused: false | |||
}; | |||
onBlur = () => { | |||
this.setState({ focused: false }); | |||
}; | |||
onFocus = () => { | |||
this.setState({ focused: true }); | |||
}; | |||
render() { | |||
const { focused } = this.state; | |||
const { label, value, onChange, ...props } = this.props; | |||
return ( | |||
<InputWrapper> | |||
{(focused || value) && <label>{label}</label>} | |||
<input | |||
onFocus={this.onFocus} | |||
onBlur={this.onBlur} | |||
value={value} | |||
onChange={event => onChange(event.target.value)} | |||
placeholder={focused ? "" : label} | |||
{...props} | |||
/> | |||
</InputWrapper> | |||
); | |||
} | |||
} | |||
const Options = styled.div` | |||
display: flex; | |||
flex-direction: row; | |||
justify-content: space-between; | |||
align-items: center; | |||
color: #333; | |||
padding-top: 1em; | |||
`; | |||
const Counter = styled.div` | |||
display: flex; | |||
border-radius: 3px; | |||
border: 1px solid #333; | |||
span { | |||
background-color: #333; | |||
color: #eee; | |||
padding: 0 1em; | |||
cursor: pointer; | |||
} | |||
input { | |||
width: 50px; | |||
border: none; | |||
text-align: center; | |||
} | |||
&:focus-within { | |||
border: 1px solid #0275d8; | |||
span { | |||
background-color: #0275d8; | |||
} | |||
} | |||
`; | |||
const CounterWrapper = styled.div` | |||
display: flex; | |||
flex-direction: column; | |||
label { | |||
font-size: 0.8em; | |||
padding-bottom: 0.5em; | |||
color: #666; | |||
} | |||
`; | |||
const CheckboxWrapper = styled.div` | |||
display: flex; | |||
align-items: center; | |||
label { | |||
font-size: 0.8em; | |||
color: #666; | |||
} | |||
`; | |||
const Button = styled.button` | |||
width: 100%; | |||
background-color: #333; | |||
color: #eee; | |||
border: none; | |||
padding: 1em; | |||
margin-top: 1em; | |||
margin-bottom: 2em; | |||
border-radius: 3px; | |||
`; | |||
class PasswordGenerationPage extends Component { | |||
state = { | |||
site: "", | |||
login: "", | |||
masterPassword: "" | |||
}; | |||
render() { | |||
const { site, login, masterPassword } = this.state; | |||
return ( | |||
<div> | |||
<Input | |||
label="Site" | |||
value={site} | |||
onChange={site => this.setState({ site })} | |||
/> | |||
<Input | |||
label="Login" | |||
value={login} | |||
onChange={login => this.setState({ login })} | |||
/> | |||
<Input | |||
label="Master Password" | |||
value={masterPassword} | |||
type="password" | |||
onChange={masterPassword => this.setState({ masterPassword })} | |||
/> | |||
<Options> | |||
<CheckboxWrapper> | |||
<input id="lowercase" type="checkbox" checked /> | |||
<label htmlFor="lowercase">a-z</label> | |||
</CheckboxWrapper> | |||
<CheckboxWrapper> | |||
<input id="uppercase" type="checkbox" checked /> | |||
<label htmlFor="uppercase">A-Z</label> | |||
</CheckboxWrapper> | |||
<CheckboxWrapper> | |||
<input id="digits" type="checkbox" checked /> | |||
<label htmlFor="digits">0-9</label> | |||
</CheckboxWrapper> | |||
<CheckboxWrapper> | |||
<input id="symbols" type="checkbox" checked /> | |||
<label htmlFor="symbols">!@%</label> | |||
</CheckboxWrapper> | |||
</Options> | |||
<Options> | |||
<CounterWrapper> | |||
<label>Length</label> | |||
<Counter> | |||
<span>-</span> | |||
<input type="number" value="16" /> | |||
<span>+</span> | |||
</Counter> | |||
</CounterWrapper> | |||
<CounterWrapper> | |||
<label>Counter</label> | |||
<Counter> | |||
<span>-</span> | |||
<input type="number" value="1" /> | |||
<span>+</span> | |||
</Counter> | |||
</CounterWrapper> | |||
</Options> | |||
<Button>GENERATE</Button> | |||
</div> | |||
); | |||
} | |||
} | |||
class LessPass extends Component { | |||
render() { | |||
return ( | |||
<MainContent> | |||
<GlobalStyle /> | |||
<Header> | |||
<HeaderImg src={Logo} alt="LessPass" /> | |||
</Header> | |||
<Content> | |||
<PasswordGenerationPage /> | |||
</Content> | |||
<Footer> | |||
<FooterItem active> | |||
<FooterIcon icon="user-secret" /> | |||
<FooterText>LessPass</FooterText> | |||
</FooterItem> | |||
<FooterItem> | |||
<FooterIcon icon="cogs" /> | |||
<FooterText>Settings</FooterText> | |||
</FooterItem> | |||
<FooterItem> | |||
<FooterIcon icon="question" /> | |||
<FooterText>Help</FooterText> | |||
</FooterItem> | |||
</Footer> | |||
</MainContent> | |||
); | |||
} | |||
} | |||
export default LessPass; |
@@ -0,0 +1,9 @@ | |||
import React from 'react'; | |||
import ReactDOM from 'react-dom'; | |||
import LessPass from './LessPass'; | |||
it('renders without crashing', () => { | |||
const div = document.createElement('div'); | |||
ReactDOM.render(<LessPass />, div); | |||
ReactDOM.unmountComponentAtNode(div); | |||
}); |
@@ -0,0 +1,5 @@ | |||
import React from 'react'; | |||
import ReactDOM from 'react-dom'; | |||
import LessPass from './LessPass'; | |||
ReactDOM.render(<LessPass />, document.getElementById('root')); |