Skip to content
This repository has been archived by the owner on Nov 6, 2020. It is now read-only.

Commit

Permalink
Go to Accounts Page if Tooltips are displayed (#3054) (#3063)
Browse files Browse the repository at this point in the history
  • Loading branch information
ngotchac authored and jacogr committed Nov 1, 2016
1 parent d0d8cde commit 183b54a
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 1 deletion.
2 changes: 1 addition & 1 deletion js/src/ui/Tooltips/tooltips.css
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
left: 0;
bottom: 0;
right: 0;
background: transparent;
background: rgba(0, 0, 0, 0.25);
z-index: 499;
}

Expand Down
21 changes: 21 additions & 0 deletions js/src/ui/Tooltips/tooltips.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 () {
Expand Down

0 comments on commit 183b54a

Please sign in to comment.