Go to Accounts Page if Tooltips are displayed (#3054) (#3063)

This commit is contained in:
Nicolas Gotchac 2016-11-01 20:37:00 +01:00 committed by Jaco Greeff
parent d0d8cde0a5
commit 183b54af84
2 changed files with 22 additions and 1 deletions

View File

@ -25,7 +25,7 @@
left: 0; left: 0;
bottom: 0; bottom: 0;
right: 0; right: 0;
background: transparent; background: rgba(0, 0, 0, 0.25);
z-index: 499; z-index: 499;
} }

View File

@ -23,6 +23,10 @@ import { nextTooltip } from './actions';
import styles from './tooltips.css'; import styles from './tooltips.css';
class Tooltips extends Component { class Tooltips extends Component {
static contextTypes = {
router: PropTypes.object.isRequired
};
static propTypes = { static propTypes = {
currentId: PropTypes.number, currentId: PropTypes.number,
closed: PropTypes.bool, closed: PropTypes.bool,
@ -33,6 +37,23 @@ class Tooltips extends Component {
const { onNextTooltip } = this.props; const { onNextTooltip } = this.props;
onNextTooltip(); 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 () { render () {