Skip to content

Commit

Permalink
Merge pull request #5 from future4code/Semana8-Projeto
Browse files Browse the repository at this point in the history
quero contartar
  • Loading branch information
Erika-Skarda authored Apr 8, 2020
2 parents 1ac60bb + 1738156 commit 496e4bd
Show file tree
Hide file tree
Showing 2 changed files with 135 additions and 3 deletions.
4 changes: 2 additions & 2 deletions future-ninjas/src/components/Header/Header.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React, { Component } from 'react';

import { Container, ContainerHeader, Logo, HeaderFl, ButtonUi } from './style';

import Button from '@material-ui/core/Button';
// import Button from '@material-ui/core/Button';

export default class Header extends Component {
render() {
Expand All @@ -11,7 +11,7 @@ export default class Header extends Component {
<ContainerHeader >
<Logo>Imagem</Logo>
<HeaderFl>
<Button variant="outlined" onClick={this.props.onChangeQueroTrabalhar}>Ver Vagas</Button>
<button onClick={this.props.onChangeQueroTrabalhar}>Ver Vagas</button>
<span>Sou Empresa</span>
<span>Sou Candidato</span>
</HeaderFl>
Expand Down
134 changes: 133 additions & 1 deletion future-ninjas/src/components/QueroContratar/QueroContratar.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,145 @@
import React from 'react';
import axios from 'axios';

class QueroContratar extends React.Component {
constructor(props) {
super(props)
this.state = {

inputTitulo:'',
inputCidade:'',
inputDescricao:'',
inputTecnologia:'',
inputValor:'',
inputDueDate:'',
inputMetodoDePagamento:''

}
}
onchangeTitulo = e => {
this.setState({inputTitulo:e.target.value})

}
onchangeCidade = e => {
this.setState({inputCidade:e.target.value})

}
onchangeDescricao = e => {
this.setState({inputDescricao:e.target.value})

}
onchangeTecnolgia = e => {
this.setState({inputTecnologia:e.target.value})

}
onchangeValor = e => {
this.setState({inputValor:e.target.value})

}
onchangeDueDate = e => {
this.setState({inputDueDate:e.target.value})

}
onchageMetodoDePagamento = e => {
this.setState({inputMetodoDePagamento:e.target.value})

}

onclickVaga = () => {
const body = {

title :this.state.inputTitulo,
cidade:this.state.inputCidade,
description:this.state.inputDescricao,
value:this.state.inputValor,
dueDate:this.state.inputDueDate,
tags:this.state.inputTecnologia,
paymentMethods:this.state.inputMetodoDePagamento
}
axios.post(`https://us-central1-future-apis.cloudfunctions.net/futureNinjas/jobs`, body,
{
headers:{

"api-token":"futureninjas",
'Content-Type': 'application/json'
}

}) .then((response) => {
window.alert("Vaga criada");
console.log(response)
})
.catch(() => {
console.log("Errorrrrrr")
})

}

render() {
return (
<h1>Teste</h1>
<div>
<h1>Teste</h1>
<form>
<label htmlFor= "título">Título: </label>
<input
value= {this.state.inputTitulo}
onChange = {this.onchangeTitulo}
name ="título"

/>
<br/>
<label htmlFor= "cidade">Cidade: </label>
<input
value= {this.state.inputCidade}
onChange = {this.onchangeCidade}
name ="cidade"

/>
<br/>

{/* <label>Método de pagamento: </label>
<select value={this.state.inputMetodoDePagamento} onChange={this.onchageMetodoDePagamento}>
<option>Cartão de crédito</option>
<option>BitCoin</option>
<option>Dinheiro</option>
</select> */}
<br/>

{/* <label htmlFor= "vencimento">Data de vencimento: </label>
<input
value= {this.state.inputDueDate}
onChange = {this.onchangeDueDate}
name ="vencimeto"
/> */}
<br/>
<label htmlFor= "valor">Valor: </label>
<input
value= {this.state.inputValor}
onChange = {this.onchangeValor}
name ="valor"

/>
<br/>
<label htmlFor= "descricao">Descrição: </label>
<textarea

value ={this.state.inputDescricao}
onChange={this.onchangeDescricao}
name ="descricao"

>
</textarea>
<br/>
{/* <label htmlFor= "tecnologias">Tecnologias: </label>
<input
value= {this.state.inputTecnologia}
onChange = {this.onchangeTecnolgia}
name ="tecnologia"
/> */}
<button onClick={this.onclickVaga}>Anunciar vaga</button>
</form>
</div>
)
}
}
Expand Down

0 comments on commit 496e4bd

Please sign in to comment.