Set href for menu items with to

This commit is contained in:
Alex Gleason
2021-03-29 23:26:50 -05:00
parent db201707bf
commit 32b3173604
2 changed files with 3 additions and 3 deletions

View File

@ -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}

View File

@ -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) });