Skip to content
Snippets Groups Projects
Commit ce23973a authored by mrp19's avatar mrp19
Browse files

fixed css do formulário

parent d0cdae16
No related branches found
No related tags found
3 merge requests!57Merge of develop into master,!56Fixed buttons reportar, seguir, compartilhar, guardar and entrar (in comments...,!12Resolve "Criar tela de contato"
...@@ -67,8 +67,12 @@ export default function FormInput(props) { ...@@ -67,8 +67,12 @@ export default function FormInput(props) {
type = {props.inputType} type = {props.inputType}
value = {props.value} value = {props.value}
onChange = {props.handleChange} onChange = {props.handleChange}
helperText = {props.help}
rows = {props.rows}
rowsMax = {props.rowsMax}
InputProps={{className: classes.input}} InputProps={{className: classes.input}}
style={{width:"100%"}} style={{width:"100%"}}
multiline = {props.multi}
/> />
</FormContainerStyled> </FormContainerStyled>
......
...@@ -19,6 +19,8 @@ along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/> ...@@ -19,6 +19,8 @@ along with Plataforma Integrada MEC. If not, see <http://www.gnu.org/licenses/>
import React, { Component, useState, useEffect } from 'react'; import React, { Component, useState, useEffect } from 'react';
import styled from 'styled-components'; import styled from 'styled-components';
import Banner1 from '../img/banner-sobre.jpg'; import Banner1 from '../img/banner-sobre.jpg';
import { TextField } from '@material-ui/core';
import FormInput from "../Components/FormInput.js"
const Seção1 = styled.div ` const Seção1 = styled.div `
width: 100%; width: 100%;
...@@ -147,6 +149,42 @@ const Seção3 = styled.div ` ...@@ -147,6 +149,42 @@ const Seção3 = styled.div `
class Contact extends Component { class Contact extends Component {
constructor (props) {
super(props);
this.state = {
nome: "",
email: "",
mensagem: ""
};
this.handleChange = this.handleChange.bind(this);
this.onSubmit = this.onSubmit.bind(this);
};
handleChange = e => {
this.setState({[e.target.name]: e.target.value})
};
onSubmit = (e) => {
//on submit we should prevent the page from refreshing
e.preventDefault(); //though this is arguable
//pass user info to Store.js and clear all text fields
console.log(this.state);
this.setState({
nome: "",
email: "",
mensagem: ""
})
}
render() { render() {
return( return(
<> <>
...@@ -160,35 +198,33 @@ class Contact extends Component { ...@@ -160,35 +198,33 @@ class Contact extends Component {
<Formulário> <Formulário>
<h2>Entre em contato para enviar dúvidas,<br/>sugestões ou críticas</h2> <h2>Entre em contato para enviar dúvidas,<br/>sugestões ou críticas</h2>
<form> <form onSubmit={this.onSubmit}>
<div className="inputBlock"> <FormInput
<label htmlFor="nome">Nome *</label> inputType={"text"}
<input name={"nome"}
required value={this.state.nome}
name="nome" placeholder={"Nome *"}
id="nome" handleChange={e => this.handleChange(e)}
/> />
</div> <FormInput
<div className="inputBlock"> inputType={"text"}
<label htmlFor="email">E-mail *</label> name={"email"}
<input value={this.state.email}
required placeholder={"E-mail *"}
name="email" handleChange={e => this.handleChange(e)}
id="email"
/> />
</div> <FormInput
<div className="inputBlock Message"> inputType={"text"}
<label htmlFor="mensagem">Mensagem *</label> name={"mensagem"}
<input value={this.state.mensagem}
required placeholder={"Mensagem *"}
nome="mensagem" multi = {true}
id="mensagem" rows = "3"
rowsMax = "5"
help="Escreva sua mensagem no campo acima."
handleChange={e => this.handleChange(e)}
/> />
</div> <button onClick={e => this.onSubmit(e)} >Enviar Mensagem</button>
<button type="submit">Enviar Mensagem</button>
</form> </form>
</Formulário> </Formulário>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment