Set href for menu items with to
This commit is contained in:
@ -140,12 +140,12 @@ class DropdownMenu extends React.PureComponent {
|
||||
return <li key={`sep-${i}`} className='dropdown-menu__separator' />;
|
||||
}
|
||||
|
||||
const { text, href = '#', newTab, isLogout } = option;
|
||||
const { text, href, to, newTab, isLogout } = option;
|
||||
|
||||
return (
|
||||
<li className='dropdown-menu__item' key={`${text}-${i}`}>
|
||||
<a
|
||||
href={href}
|
||||
href={href || to || '#'}
|
||||
role='button'
|
||||
tabIndex='0'
|
||||
ref={i === 0 ? this.setFocusRef : null}
|
||||
|
||||
@ -103,7 +103,7 @@ class ProfileDropdown extends React.PureComponent {
|
||||
|
||||
let menu = [];
|
||||
|
||||
menu.push({ text: this.renderAccount(account), to: `/@${account.get('acct')}`, href: '/', middleClick: this.handleMiddleClick(account) });
|
||||
menu.push({ text: this.renderAccount(account), to: `/@${account.get('acct')}` });
|
||||
|
||||
otherAccounts.forEach(account => {
|
||||
menu.push({ text: this.renderAccount(account), action: this.handleSwitchAccount(account), href: '/', middleClick: this.handleMiddleClick(account) });
|
||||
|
||||
Reference in New Issue
Block a user