Skip to content

Commit

Permalink
ajusta lint e finaliza requisito 2
Browse files Browse the repository at this point in the history
  • Loading branch information
Pedroicn committed Aug 29, 2022
1 parent 8f31970 commit 57b4a12
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/App.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ body {
min-height: 100vh;
}

#login-form {
.login-form {
align-items: center;
background-color: rgb(90, 80, 66);
border: 2px solid black;
Expand Down
19 changes: 17 additions & 2 deletions src/components/Header.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,26 @@
import React, { Component } from 'react';
import { connect } from 'react-redux';
import PropTypes from 'prop-types';

class Header extends Component {
render() {
const { email } = this.props;
return (
<div>Header</div>
<header>
<p data-testid="header-currency-field">BRL</p>
<p data-testid="total-field">0</p>
<p data-testid="email-field">{ email }</p>
</header>
);
}
}

export default Header;
const mapStateToProps = (state) => ({
email: state.user.email,
});

Header.propTypes = {
email: PropTypes.string.isRequired,
};

export default connect(mapStateToProps)(Header);
3 changes: 1 addition & 2 deletions src/pages/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ class Login extends React.Component {
handleSubmit(event) {
event.preventDefault();
const { dispatch, history } = this.props;
console.log(this.props);
const { email } = this.state;
dispatch(getUserAction(email));
history.push('/carteira');
Expand All @@ -42,7 +41,7 @@ class Login extends React.Component {
render() {
const { email, senha, isDisable } = this.state;
return (
<form onSubmit={ this.handleSubmit } id="login-form">
<form onSubmit={ this.handleSubmit } className="login-form">
<label htmlFor="email">
E-mail:
<input
Expand Down
7 changes: 6 additions & 1 deletion src/pages/Wallet.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,13 @@
import React from 'react';
import Header from '../components/Header';

class Wallet extends React.Component {
render() {
return <div>TrybeWallet</div>;
return (
<main>
<Header />
</main>
);
}
}

Expand Down

0 comments on commit 57b4a12

Please sign in to comment.