|
|
|
@ -72,16 +72,32 @@ class BanksIndex extends Component{
|
|
|
|
|
constructor(props){
|
|
|
|
|
super(props);
|
|
|
|
|
this.state={
|
|
|
|
|
crumbData:undefined
|
|
|
|
|
crumbData:undefined,
|
|
|
|
|
publicly:undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidMount = () =>{
|
|
|
|
|
let pathname = this.props.location.pathname;
|
|
|
|
|
this.setState({
|
|
|
|
|
publicly:pathname.indexOf("/publicly") > -1
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
initPublic = (crumbData) =>{
|
|
|
|
|
this.setState({
|
|
|
|
|
crumbData
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
componentDidUpdate=()=>{
|
|
|
|
|
let { publicly }=this.state
|
|
|
|
|
|
|
|
|
|
if(this.props.current_user && this.props.current_user.professional_certification == false && publicly){
|
|
|
|
|
this.props.history.push(`/topicbank/${this.props.current_user.login}/publicly`);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
render(){
|
|
|
|
|
let { crumbData }=this.state
|
|
|
|
|
const common = {
|
|
|
|
|