import React, { Component } from 'react'; import { connect } from 'react-redux'; import { FauxModal } from '../components/FauxModal'; import Flash from '../components/Flash'; import FormBuskerEventRejection from '../containers/FormBuskerEventRejection'; import { getReasons } from '../actions/buskerRejectionActions'; import PropTypes from 'prop-types'; class BuskerRejectionLanding extends Component { constructor(props) { super(props); this.state = { messages: {}, timeMsg: 4000 } this.handleFlashClose = this.handleFlashClose.bind(this); } static getDerivedStateFromProps(props, state) { if (props.flash.id !== state.messages.id) { return { messages: props.flash } } return null; } componentDidMount() { const { dispatch } = this.props; dispatch(getReasons); } // UNSAFE_componentWillReceiveProps(nextProps) { // const { flash, redirect } = this.props; // // if (nextProps.flash.msg !== flash.msg) { // this.setState({ // messages: nextProps.flash // }) // } // if (nextProps.redirect !== redirect) { // if (true) { // // } // // } // } handleFlashClose() { this.setState({ messages: { id: this.state.messages.id, msg: null, type: null } }) } render() { const { dispatch, eventCurrency, eventLocation, isProfileEvent, reasonsInfo, redirect } = this.props; const { messages, timeMsg } = this.state; return(