parent
d0d8cde0a5
commit
183b54af84
@ -25,7 +25,7 @@
|
||||
left: 0;
|
||||
bottom: 0;
|
||||
right: 0;
|
||||
background: transparent;
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
z-index: 499;
|
||||
}
|
||||
|
||||
|
@ -23,6 +23,10 @@ import { nextTooltip } from './actions';
|
||||
import styles from './tooltips.css';
|
||||
|
||||
class Tooltips extends Component {
|
||||
static contextTypes = {
|
||||
router: PropTypes.object.isRequired
|
||||
};
|
||||
|
||||
static propTypes = {
|
||||
currentId: PropTypes.number,
|
||||
closed: PropTypes.bool,
|
||||
@ -33,6 +37,23 @@ class Tooltips extends Component {
|
||||
const { onNextTooltip } = this.props;
|
||||
|
||||
onNextTooltip();
|
||||
this.redirect();
|
||||
}
|
||||
|
||||
componentWillReceiveProps (nextProps) {
|
||||
if (nextProps.currentId !== this.props.currentId) {
|
||||
this.redirect(nextProps);
|
||||
}
|
||||
}
|
||||
|
||||
redirect (props = this.props) {
|
||||
const { currentId } = props;
|
||||
|
||||
console.log('c', { currentId });
|
||||
if (currentId !== undefined && currentId !== -1) {
|
||||
const viewLink = '/accounts/';
|
||||
this.context.router.push(viewLink);
|
||||
}
|
||||
}
|
||||
|
||||
render () {
|
||||
|
Loading…
Reference in New Issue
Block a user