You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
958 B
43 lines
958 B
import React,{ Component } from "react";
|
|
|
|
import '../css/members.css'
|
|
import '../css/busyWork.css'
|
|
import './pollStyle.css'
|
|
|
|
import PollDetailTabThirdInfo from './PollDetailTabThirdInfo'
|
|
|
|
import axios from 'axios';
|
|
|
|
class PollDetailTabThird extends Component{
|
|
constructor(props){
|
|
super(props);
|
|
this.state={
|
|
pollDetail:undefined
|
|
}
|
|
}
|
|
getPollInfo=()=>{
|
|
let pollId=this.props.match.params.pollId;
|
|
let url=`/polls/${pollId}.json`;
|
|
axios.get(url).then((result)=>{
|
|
if(result.status==200){
|
|
this.setState({
|
|
pollDetail:result.data
|
|
})
|
|
}
|
|
}).catch((error)=>{
|
|
console.log(error);
|
|
})
|
|
}
|
|
componentDidMount=()=>{
|
|
this.getPollInfo();
|
|
}
|
|
render(){
|
|
let {pollDetail}=this.state;
|
|
return(
|
|
<div>
|
|
<PollDetailTabThirdInfo {...this.props} {...this.state} pollDetail = {pollDetail}></PollDetailTabThirdInfo>
|
|
</div>
|
|
)
|
|
}
|
|
}
|
|
export default PollDetailTabThird |