Merge branch 'next-dashboard' into 'next'

Next: Restore Dashboard links to navigation

See merge request soapbox-pub/soapbox-fe!1214
This commit is contained in:
Alex Gleason 2022-04-13 23:30:00 +00:00
commit 7f09ab6f6e
2 changed files with 7 additions and 6 deletions

View file

@ -17,6 +17,7 @@ const SidebarNavigation = () => {
const account = useAppSelector((state) => state.accounts.get(me));
const notificationCount = useAppSelector((state) => state.notifications.get('unread'));
const chatsCount = useAppSelector((state) => state.chats.get('items').reduce((acc: any, curr: any) => acc + Math.min(curr.get('unread', 0), 1), 0));
const dashboardCount = useAppSelector((state) => state.admin.openReports.count() + state.admin.awaitingApproval.count());
const baseURL = getBaseURL(ImmutableMap(account));
const features = getFeatures(instance);
@ -70,14 +71,14 @@ const SidebarNavigation = () => {
)
)}
{/* {(account && account.staff) && (
{(account && account.staff) && (
<SidebarNavigationLink
to='/admin'
icon={location.pathname.startsWith('/admin') ? require('icons/dashboard-filled.svg') : require('@tabler/icons/icons/dashboard.svg')}
icon={require('@tabler/icons/icons/dashboard.svg')}
text={<FormattedMessage id='tabs_bar.dashboard' defaultMessage='Dashboard' />}
count={dashboardCount}
/>
)} */}
)}
{(account && instance.invites_enabled) && (
<SidebarNavigationLink

View file

@ -9,7 +9,7 @@ const ThumbNavigation: React.FC = (): JSX.Element => {
const account = useOwnAccount();
const notificationCount = useAppSelector((state) => state.notifications.unread);
const chatsCount = useAppSelector((state) => state.chats.get('items').reduce((acc: number, curr: any) => acc + Math.min(curr.get('unread', 0), 1), 0));
// const dashboardCount = useAppSelector((state) => state.admin.openReports.count() + state.admin.awaitingApproval.count());
const dashboardCount = useAppSelector((state) => state.admin.openReports.count() + state.admin.awaitingApproval.count());
const features = getFeatures(useAppSelector((state) => state.instance));
return (
@ -57,14 +57,14 @@ const ThumbNavigation: React.FC = (): JSX.Element => {
)
)}
{/* (account && account.staff && (
{(account && account.staff) && (
<ThumbNavigationLink
src={require('@tabler/icons/icons/dashboard.svg')}
text={<FormattedMessage id='navigation.dashboard' defaultMessage='Dashboard' />}
to='/admin'
count={dashboardCount}
/>
) */}
)}
</div>
);
};