import React, { Component } from "react";
import { withRouter, } from "react-router-dom";
import { Row,Col,Container } from 'react-bootstrap'
class OpinionesPage extends Component {
constructor(props) {
super(props);
this.state = {
indexItemImage: -1,
}
}
componentDidMount() {
}
render() {
const { arrDatos, } = this.props.initState
const { arrCarouselOp } = arrDatos
const { arrOpiniones,checked } = arrCarouselOp
return (
);
}
onFileChange(index, file) {
const { arrDatos, } = this.props.initState
const { arrCarouselOp } = arrDatos
const { arrOpiniones } = arrCarouselOp
const imgURL = URL.createObjectURL( file.target.files[0] )
arrOpiniones[index].img = imgURL
arrOpiniones[index].files = file.target.files[0]
this.initsetState({ arrDatos });
this.checkMarkValues();
}
checkMarkValues(){
const { arrDatos,arrCheck } = this.props.initState
const { arrCarouselOp } = arrDatos
if(arrCarouselOp.arrOpiniones.length > 0){
arrCheck[7].checkMark = true;
}else{
arrCheck[7].checkMark = false;
}
}
onAddDiapo() {
const { arrDatos, } = this.props.initState
const { arrCarouselOp } = arrDatos
const { arrOpiniones } = arrCarouselOp
arrOpiniones.push({
img: 'img/icons/profile2.png',
val: '',
autor: '',
trabajo: ''
})
this.initsetState({ arrDatos })
}
removeImageFromCarrete(e){
const { arrDatos } = this.props.initState
const { arrCarouselOp } = arrDatos
const { arrOpiniones } = arrCarouselOp
arrOpiniones.splice(e,1)
this.initsetState({ arrDatos })
}
initsetState(param) {
this.props.initsetState(param)
return true
}
};
export default withRouter(OpinionesPage)