import React, { Component } from 'react'; import { Container, Row, Col, Table, FormGroup, Input, Button, Label } from 'reactstrap'; import Results from './results' import 'bootstrap/dist/css/bootstrap.min.css'; import '../../App.css'; class Gearbox extends Component { state = {}; constructor(props) { super(props); const sizes = []; for (let i = 10; i <= 24; i += 1) { sizes.push(i); } this.state = { sizes, showResult: false, wheelDiameter: 14, tyreWidth: 175, tyreHeight: 65, oldGearBoxOne: '11/37', oldGearBoxSecond: '22/41', oldGearBoxThird: '28/37', oldGearBoxFourth: '34/35', oldGearBoxFifth: '39/32', oldGearBoxSixth: '', oldGearBoxGate: '15/61', oldGearBoxReverse: '11/39', newGearBoxOne: '11/41', newGearBoxSecond: '21/43', newGearBoxThird: '28/37', newGearBoxFourth: '30/29', newGearBoxFifth: '39/31', newGearBoxSixth: '', newGearBoxGate: '14/63', newGearBoxReverse: '11/39', rpm: 2500, speed: 90 }; this.handleChange = this.handleChange.bind(this); this.submit = this.submit.bind(this); } handleChange(event) { const target = event.target; const value = target.type === 'checkbox' ? target.checked : target.value; const name = target.name; this.setState({ [name]: value, showResult: false }); } submit() { this.setState({ showResult: true }) } render() { return (

Calculez vos rapports de boîte

Roue

Diamètre Largeur du pneu Hauteur du flanc
{ this.state.sizes.map( item => ( ))}

Boîte de vitesse

1ère 2ère 3ère 4ère 5ère 6ère Pont Marche arrière
Actuelle
Nouvelle

Bonus

{ this.state.showResult ? : (null) }
) } } export default Gearbox;