import React, { Component } from "react"; import { withRouter, } from "react-router-dom"; import { Row, Container } from 'react-bootstrap' class IntroduccionPage extends Component { constructor(props) { super(props); this.state = { } } componentDidMount() { } onChangeParentData(opt, value) { const { arrDatos } = this.props.initState const { ubicacion } = arrDatos if(opt === 'direccion') { ubicacion.direccion = value } else if(opt === 'ciudad') { ubicacion.ciudad = value } else if(opt === 'codigoPostal') { ubicacion.codigoPostal = value } else if(opt === 'estado') { ubicacion.estado = value } this.props.initsetState({ arrDatos }) } checkMarkValues(){ const { arrDatos,arrCheck } = this.props.initState const { ubicacion } = arrDatos if(ubicacion.direccion!='' && ubicacion.ciudad!='' && ubicacion.codigoPostal!='' && ubicacion.estado!=''){ arrCheck[8].checkMark = true; }else{ arrCheck[8].checkMark = false; } } render() { const { arrDatos } = this.props.initState const { ubicacion } = arrDatos const { direccion, ciudad, codigoPostal, estado,checked } = ubicacion return (
{ /*
*/ }
{ const check = this.props.initState.arrDatos.ubicacion.checked = !checked; this.props.initsetState({ check }) } } />

Dirección *

{ this.onChangeParentData('direccion', event.target.value); this.checkMarkValues(); }} type={'text'} placeholder={ 'Dirección' } value={ direccion }/>

Ciudad *

{ this.onChangeParentData('ciudad', event.target.value); this.checkMarkValues(); }} type={'text'} placeholder={ 'Ciudad' } value={ ciudad }/>

Código Postal *

{ this.onChangeParentData('codigoPostal', event.target.value); this.checkMarkValues(); }} type={'text'} placeholder={ 'Código Postal' } value={ codigoPostal } />

Estado *

{ this.onChangeParentData('estado', event.target.value); this.checkMarkValues(); }} type={'text'} placeholder={ 'Estado' } value={ estado }/>
); } initsetState(param) { this.props.initsetState(param) return true } }; export default withRouter(IntroduccionPage)