import React, { Component } from "react"; import { withRouter, } from "react-router-dom"; import { Row,Col,Container } from 'react-bootstrap' import axios from 'axios'; class DocumentosPage extends Component { constructor(props) { super(props); this.state = { indexItemImage: -1, } } componentDidMount() { } render() { const { arrDatos, } = this.props.initState let { arrDocumentos } = arrDatos const { arrFiles,checked } = arrDocumentos return (
{ const check = this.props.initState.arrDatos.arrDocumentos.checked = !checked; this.props.initsetState({ check }) } } />

Título

{ arrDocumentos.title = event.target.value; this.initsetState({ arrDatos }) } } type={'text'} placeholder={ 'Ingresa un título a tu nube' } value={ arrDocumentos.title } /> { arrFiles.map((t,e) => (
{ t.url === '' ? (

Agrega un documento...

) : ( { arrFiles[e].title = event.target.value; this.initsetState({ arrDatos }) } } /> ) }
)) }
); } onFileChange(index, file) { const { arrDatos, } = this.props.initState const { arrDocumentos } = arrDatos const { arrFiles } = arrDocumentos const imgURL = URL.createObjectURL( file.target.files[0] ) arrFiles[index].url = imgURL arrFiles[index].files = file.target.files[0] arrFiles[index].title = file.target.files[0].name this.initsetState({ arrDatos }); this.checkMarkValues(); } checkMarkValues() { const { arrDatos,arrCheck } = this.props.initState const { arrDocumentos } = arrDatos if(arrDocumentos.arrFiles.length > 0) { arrCheck[6].checkMark = true; }else{ arrCheck[6].checkMark = false; } } removeImageFromCarrete(e) { const { arrDatos } = this.props.initState const { arrDocumentos } = arrDatos const { arrFiles } = arrDocumentos arrFiles.splice(e,1) this.initsetState({ arrDatos }) } onAddDiapo() { const { arrDatos, } = this.props.initState const { arrDocumentos } = arrDatos const { arrFiles } = arrDocumentos arrFiles.push({ url: '', title: '', }) this.initsetState({ arrDatos }) } initsetState(param) { this.props.initsetState(param) return true } }; export default withRouter(DocumentosPage)