Skip to content
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

[MATHEUS FERREIRA] - Project Password Generator #1

Open
wants to merge 47 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 46 commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
57c7a17
PR
matheus-ferreira02 Feb 1, 2022
7297ea1
criaçao da estrutura do site
matheus-ferreira02 Feb 1, 2022
6e4042a
prop-types
matheus-ferreira02 Feb 1, 2022
283dad7
Merge pull request #5 from tryber/matheus-ferreira-prop-types
matheus-ferreira02 Feb 1, 2022
8443430
estilo basico
matheus-ferreira02 Feb 1, 2022
b5656c6
checkpoint 1
matheus-ferreira02 Feb 1, 2022
8359a43
estilo do botao
matheus-ferreira02 Feb 1, 2022
15faa50
estilo do checkbox
matheus-ferreira02 Feb 1, 2022
11a6fd9
style done
matheus-ferreira02 Feb 1, 2022
8add976
Merge pull request #6 from tryber/matheus-ferreira-estilo-css
matheus-ferreira02 Feb 1, 2022
9d47d5e
gerador de senha de acordo com o tamanho escolhido
matheus-ferreira02 Feb 2, 2022
a9923e0
prop-types das props
matheus-ferreira02 Feb 2, 2022
7724dcc
correçao do bug undefined
matheus-ferreira02 Feb 2, 2022
5588d83
gerador de senhas de acordo com o tamanho: done
matheus-ferreira02 Feb 2, 2022
3e002b5
Merge pull request #9 from tryber/matheus-ferreira-gerar-senha
matheus-ferreira02 Feb 2, 2022
2b529c2
e
matheus-ferreira02 Feb 2, 2022
30c2951
validacao do botao done
matheus-ferreira02 Feb 2, 2022
190b62c
Merge pull request #10 from tryber/matheus-ferreira-estados-checkbox
matheus-ferreira02 Feb 2, 2022
56f70b8
criaçao da store done
matheus-ferreira02 Feb 4, 2022
ec5f07d
Merge pull request #11 from tryber/matheus-ferreira-atualizando-state…
matheus-ferreira02 Feb 4, 2022
268a1f5
alteraçao do package json
matheus-ferreira02 Feb 4, 2022
fde8ed1
redux da senha e do tamanhao da senha done
matheus-ferreira02 Feb 4, 2022
8480195
Merge pull request #12 from tryber/matheus-ferreira-aplicando-redux
matheus-ferreira02 Feb 5, 2022
bfe37cd
logica de gerar senha done
matheus-ferreira02 Feb 5, 2022
486fd89
Merge pull request #13 from tryber/matheus-ferreira-criando-logica-do…
matheus-ferreira02 Feb 5, 2022
d046f89
botao de copiar (done)
matheus-ferreira02 Feb 6, 2022
aafc762
Merge pull request #15 from tryber/matheus-ferreira-criando-botao-copiar
matheus-ferreira02 Feb 6, 2022
d982e79
media query (done)
matheus-ferreira02 Feb 6, 2022
52ef569
Merge pull request #16 from tryber/matheus-ferreira-media-query
matheus-ferreira02 Feb 6, 2022
fbb30d1
.
matheus-ferreira02 Feb 6, 2022
c4207c0
pequenas alteraçoes no css
matheus-ferreira02 Feb 6, 2022
d64ab94
pequenas alteraçoes no index.html
matheus-ferreira02 Feb 6, 2022
8a9a3f7
done
matheus-ferreira02 Feb 7, 2022
69a9576
done
matheus-ferreira02 Feb 7, 2022
ca4685f
Merge pull request #17 from tryber/matheus-ferreira-alterando-para-while
matheus-ferreira02 Feb 7, 2022
914194c
.
matheus-ferreira02 Feb 7, 2022
eba1aeb
teste da tela inicial
matheus-ferreira02 Feb 9, 2022
3331514
teste dos inputs checkbox
matheus-ferreira02 Feb 9, 2022
f770074
testes do botão done
matheus-ferreira02 Feb 9, 2022
6c167dd
teste dos tamanhos das senhas
matheus-ferreira02 Feb 9, 2022
b7b01c1
testes se a senha está de acordo com cada opção
matheus-ferreira02 Feb 9, 2022
a19d6ef
testes concluidos
matheus-ferreira02 Feb 9, 2022
62a16c3
repassando pelo código
matheus-ferreira02 Feb 9, 2022
6f5408a
Merge pull request #18 from tryber/matheus-ferreira-testes
matheus-ferreira02 Feb 9, 2022
b1e7142
função refatorada
matheus-ferreira02 Feb 9, 2022
cdd1694
Merge pull request #19 from tryber/matheus-ferreira-refatorando-funções
matheus-ferreira02 Feb 9, 2022
78a108b
alterações do cod-review
matheus-ferreira02 Feb 14, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43,098 changes: 15,129 additions & 27,969 deletions package-lock.json

Large diffs are not rendered by default.

11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,21 @@
"node": "16"
},
"dependencies": {
"@fortawesome/fontawesome-svg-core": "^1.2.36",
"@fortawesome/free-solid-svg-icons": "^5.15.4",
"@fortawesome/react-fontawesome": "^0.1.17",
"@testing-library/jest-dom": "^5.16.1",
"@testing-library/react": "^12.1.2",
"@testing-library/user-event": "^13.5.0",
"copy-to-clipboard": "^3.3.1",
"eslint-config-airbnb": "^18.0.1",
"eslint-plugin-jsx-a11y": "^6.2.3",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",
"react-redux": "^7.2.6",
"react-scripts": "5.0.0",
"redux": "^4.1.2",
"redux-devtools-extension": "^2.13.9",
"web-vitals": "^2.1.4"
},
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
-->
<title>React App</title>
</head>
<body>
<body class="body">
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
Expand Down
46 changes: 17 additions & 29 deletions src/App.css
Original file line number Diff line number Diff line change
@@ -1,38 +1,26 @@
.App {
text-align: center;
background-color: #0B0F2F;
border-radius: 10px;
height: 90vh;
width: 90vw;
box-shadow: 0 0 1em #0B0F2F;
}

.App-logo {
height: 40vmin;
pointer-events: none;
.box_style {
border-radius: 10px;
background-color: #1E223F;
padding: 15px;
}

@media (prefers-reduced-motion: no-preference) {
.App-logo {
animation: App-logo-spin infinite 20s linear;
}
}

.App-header {
background-color: #282c34;
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
font-size: calc(10px + 2vmin);
color: white;
.legend {
font-size: 0.8em;
color: #5F6176;
font-weight: 700;
}

.App-link {
color: #61dafb;
}

@keyframes App-logo-spin {
from {
transform: rotate(0deg);
}
to {
transform: rotate(360deg);
@media only screen and (min-width: 768px) {
.App {
width: 700px;
}
}
}
23 changes: 6 additions & 17 deletions src/App.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,13 @@
import logo from './logo.svg';
import Header from './components/Header/Header';
import Main from './components/Main/Main';
import './App.css';

function App() {
return (
<div className="App">
<header className="App-header">
<img src={logo} className="App-logo" alt="logo" />
<p>
Edit <code>src/App.js</code> and save to reload.
</p>
<a
className="App-link"
href="https://reactjs.org"
target="_blank"
rel="noopener noreferrer"
>
Learn React
</a>
</header>
</div>
<section className="App">
<Header />
<Main />
</section>
);
}

Expand Down
8 changes: 0 additions & 8 deletions src/App.test.js

This file was deleted.

13 changes: 13 additions & 0 deletions src/components/BtnGenerate/BtnGenerate.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
.btn {
border: none;
background-image: linear-gradient(to right, #697BDD, #6F52A2);
color: #fafafa;
padding: 15px;
border-radius: 8px;
font-weight: 800;
transition: .4s all ease;
}

.btn:disabled {
opacity: 0.5;
}
25 changes: 25 additions & 0 deletions src/components/BtnGenerate/BtnGenerate.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './BtnGenerate.css';

export default class BtnGenerate extends Component {
render() {
const { onClick, buttonDisabled } = this.props;

return (
<button
className="btn"
type="submit"
onClick={ onClick }
disabled={ buttonDisabled }
>
GENERATE PASSWORD
</button>
);
}
}

BtnGenerate.propTypes = {
onClick: PropTypes.func,
buttonDisabled: PropTypes.bool,
}
52 changes: 52 additions & 0 deletions src/components/Checkbox/Checkbox.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
.switch {
display: flex;
justify-content: space-between;
align-items: center;
cursor: pointer;
}

.switch .switch-wrapper {
display: inline-block;
width: 50px;
height: 25px;
position: relative;
}

.switch .switch-wrapper .switch-button {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
justify-content: space-between;
align-items: center;
border-radius: 20px;
background-color: #475569;
}

.switch .switch-wrapper input {
opacity: 0;
width: 0;
height: 0;
}

.switch .switch-wrapper .switch-button::before {
content: "";
width: 21px;
height: 21px;
position: absolute;
left: 2px;
bottom: 2px;
border-radius: 50%;
transition: .4s all ease;
background-color: aliceblue;
}

.switch .switch-wrapper input:checked + .switch-button {
background-color: #5E6BDA;
}

.switch .switch-wrapper input:checked + .switch-button::before {
transform: translateX(25px);
}
33 changes: 33 additions & 0 deletions src/components/Checkbox/Checkbox.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import './Checkbox.css';

export default class Checkbox extends Component {
render() {
const { id, label, checked, onChange, name } = this.props;

return (
<label className="box_style switch" htmlFor={ id }>
<span className="switch-text">{ label }</span>
<div className="switch-wrapper">
<input
id={ id }
type="checkbox"
checked={ checked }
onChange={ onChange }
name={ name }
/>
<span className="switch-button"></span>
</div>

</label>
);
}
}

Checkbox.propTypes = {
id: PropTypes.string,
label: PropTypes.string,
name: PropTypes.string,
checked: PropTypes.bool,
}.isRequired;
5 changes: 5 additions & 0 deletions src/components/Header/Header.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.body_header h1 {
font-weight: 500;
height: 15%;
padding: 15px;
}
12 changes: 12 additions & 0 deletions src/components/Header/Header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import React, { Component } from 'react';
import './Header.css';

export default class Header extends Component {
render() {
return (
<header className="body_header">
<h1>Password Generator</h1>
</header>
);
}
}
42 changes: 42 additions & 0 deletions src/components/LengthCaracters/LengthCaracters.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
.slider {
width: 100%;
-webkit-appearance: none;
background-color: #454760;
height: 15px;
align-self: center;
outline: none;
transition: 0.2s;
overflow: hidden;
box-shadow: inset 0 0 5px rgba(0,0,0,1);
border-radius: 10px;
}

.slider::-webkit-slider-thumb {
-webkit-appearance: none;
appearance: none;
width: 15px;
height: 15px;
border-radius: 50%;
background-color: #fafafa;
cursor: pointer;
z-index: 3;
position: relative;
box-shadow: -407px 0 0 400px #5E6BDA;
}

.slider::-moz-range-progress {
background-color: blue;
height: 15px;
}

.input_length {
display: flex;
}

.input_length .min_length {
margin-right: 10px;
}

.input_length .max_length {
margin-left: 10px;
}
57 changes: 57 additions & 0 deletions src/components/LengthCaracters/LengthCaracters.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { lengthPassword } from '../../redux/actions';
import './LengthCaracters.css';

class LengthCaracters extends Component {
constructor() {
super();

this.state = {
lengthPassword: '4',
matheus-ferreira02 marked this conversation as resolved.
Show resolved Hide resolved
}
}

handleLength = ({ target: { value } }) => {
const { attLength } = this.props;
this.setState({ lengthPassword: value });

attLength(value);
}

render() {
const { lengthPassword } = this.state;

return (
<section data-testid="option-length" className="main_length">
<p className="legend">{`LENGTH: ${ lengthPassword }`}</p>
<div className="box_style input_length">
<span className="min_length">4</span>
<input
className="slider"
type="range"
min="4"
max="20"
value={ lengthPassword }
onChange={ this.handleLength }
/>

<span className="max_length">20</span>
</div>

</section>

);
}
}

LengthCaracters.propTypes = {
attLength: PropTypes.func,
}.isRequired;

const mapDispatchToProps = (dispatch) => ({
attLength: (value) => dispatch(lengthPassword(value)),
})

export default connect(null, mapDispatchToProps)(LengthCaracters);
Loading