use canonical url in channel dropdown
This commit is contained in:
parent
033c3d7f12
commit
bc4f3eec10
1 changed files with 3 additions and 1 deletions
|
@ -1,6 +1,7 @@
|
|||
import React from 'react';
|
||||
import { NavLink, withRouter } from 'react-router-dom';
|
||||
import NavBarChannelOptionsDropdown from '@components/NavBarChannelOptionsDropdown';
|
||||
import createCanonicalLink from '../../../../utils/createCanonicalLink';
|
||||
|
||||
const VIEW = 'VIEW';
|
||||
const LOGOUT = 'LOGOUT';
|
||||
|
@ -14,6 +15,7 @@ class NavigationLinks extends React.Component {
|
|||
this.props.checkForLoggedInChannel();
|
||||
}
|
||||
handleSelection (event) {
|
||||
const { history, channelName: name, channelShortId: shortId } = this.props;
|
||||
const value = event.target.selectedOptions[0].value;
|
||||
switch (value) {
|
||||
case LOGOUT:
|
||||
|
@ -21,7 +23,7 @@ class NavigationLinks extends React.Component {
|
|||
break;
|
||||
case VIEW:
|
||||
// redirect to channel page
|
||||
this.props.history.push(`/${this.props.channelName}:${this.props.channelLongId}`);
|
||||
history.push(createCanonicalLink({ channel: { name, shortId } }));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
Loading…
Add table
Reference in a new issue