Show nav bar links when in dashboard

Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
strip-front-mentions
marcin mikołajczak 2021-12-20 22:41:40 +01:00
rodzic 829744dcce
commit 5979aa14f8
1 zmienionych plików z 4 dodań i 4 usunięć

Wyświetl plik

@ -53,10 +53,10 @@ class TabsBar extends React.PureComponent {
return pathname === '/' || pathname.startsWith('/timeline/'); return pathname === '/' || pathname.startsWith('/timeline/');
} }
onProfilePage = () => { shouldShowLinks = () => {
try { try {
const { pathname } = this.context.router.route.location; const { pathname } = this.context.router.route.location;
return pathname.startsWith('/@') && !pathname.includes('/posts/'); return (pathname.startsWith('/@') && !pathname.includes('/posts/')) || pathname.startsWith('/admin');
} catch { } catch {
return false; return false;
} }
@ -65,7 +65,7 @@ class TabsBar extends React.PureComponent {
render() { render() {
const { intl, account, logo, onOpenCompose, onOpenSidebar, features, dashboardCount, notificationCount, chatsCount } = this.props; const { intl, account, logo, onOpenCompose, onOpenSidebar, features, dashboardCount, notificationCount, chatsCount } = this.props;
const { collapsed } = this.state; const { collapsed } = this.state;
const profilePage = this.onProfilePage(); const showLinks = this.shouldShowLinks();
const classes = classNames('tabs-bar', { const classes = classNames('tabs-bar', {
'tabs-bar--collapsed': collapsed, 'tabs-bar--collapsed': collapsed,
@ -94,7 +94,7 @@ class TabsBar extends React.PureComponent {
<div className='tabs-bar__split tabs-bar__split--right'> <div className='tabs-bar__split tabs-bar__split--right'>
{account ? ( {account ? (
<> <>
{profilePage && ( {showLinks && (
<> <>
<NavLink key='notifications' className='tabs-bar__link' to='/notifications' data-preview-title-id='column.notifications'> <NavLink key='notifications' className='tabs-bar__link' to='/notifications' data-preview-title-id='column.notifications'>
<IconWithCounter <IconWithCounter