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

Go to Accounts Page if Tooltips are displayed #3063

Merged
merged 1 commit into from
Nov 1, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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