import { Map as ImmutableMap } from 'immutable'; import React from 'react'; import { FormattedMessage } from 'react-intl'; import { getSettings } from 'soapbox/actions/settings'; import ComposeButton from 'soapbox/features/ui/components/compose-button'; import { useAppSelector } from 'soapbox/hooks'; import { getBaseURL } from 'soapbox/utils/accounts'; import { getFeatures } from 'soapbox/utils/features'; import SidebarNavigationLink from './sidebar-navigation-link'; const SidebarNavigation = () => { const me = useAppSelector((state) => state.me); const instance = useAppSelector((state) => state.instance); const settings = useAppSelector((state) => getSettings(state)); 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 baseURL = getBaseURL(ImmutableMap(account)); const features = getFeatures(instance); return (
} /> {account && ( <> } /> } /> } /> )} {account && ( features.chats ? ( } /> ) : ( } /> ) )} {/* {(account && isStaff(account)) && ( } count={dashboardCount} /> )} */} {(account && instance.get('invites_enabled')) && ( } /> )} {(settings.get('isDeveloper')) && ( } /> )} {/* {features.federating ? ( {instance.get('title')} ) : ( )} {features.federating && ( )} */}
{account && ( )}
); }; export default SidebarNavigation;