Add tabs to dashboard

This commit is contained in:
Alex Gleason 2022-04-28 14:06:47 -05:00
parent f088e63ec8
commit a8f2ca83a1
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7
3 changed files with 16 additions and 8 deletions

View file

@ -3,7 +3,7 @@ import { defineMessages, useIntl, FormattedMessage, FormattedNumber } from 'reac
import { Link } from 'react-router-dom'; import { Link } from 'react-router-dom';
import { getSubscribersCsv, getUnsubscribersCsv, getCombinedCsv } from 'soapbox/actions/email_list'; import { getSubscribersCsv, getUnsubscribersCsv, getCombinedCsv } from 'soapbox/actions/email_list';
import { Text } from 'soapbox/components/ui'; import { Text, Tabs } from 'soapbox/components/ui';
import { useAppSelector, useAppDispatch, useOwnAccount, useFeatures } from 'soapbox/hooks'; import { useAppSelector, useAppDispatch, useOwnAccount, useFeatures } from 'soapbox/hooks';
import sourceCode from 'soapbox/utils/code'; import sourceCode from 'soapbox/utils/code';
import { parseVersion } from 'soapbox/utils/features'; import { parseVersion } from 'soapbox/utils/features';
@ -70,9 +70,22 @@ const Dashboard: React.FC = () => {
if (!account) return null; if (!account) return null;
const tabs = [{
name: 'dashboard',
text: 'Dashboard',
}, {
name: 'reports',
text: 'Reports',
}, {
name: 'approval',
text: 'Waitlist',
}];
return ( return (
<Column icon='tachometer-alt' label={intl.formatMessage(messages.heading)}> <Column label={intl.formatMessage(messages.heading)} withHeader={false}>
<div className='dashcounters'> <Tabs items={tabs} activeItem='dashboard' />
<div className='dashcounters mt-8'>
{isNumber(mau) && ( {isNumber(mau) && (
<div className='dashcounter'> <div className='dashcounter'>
<Text align='center' size='2xl' weight='medium'> <Text align='center' size='2xl' weight='medium'>

View file

@ -4,7 +4,6 @@ import SidebarNavigation from 'soapbox/components/sidebar-navigation';
import { Layout } from 'soapbox/components/ui'; import { Layout } from 'soapbox/components/ui';
import BundleContainer from 'soapbox/features/ui/containers/bundle_container'; import BundleContainer from 'soapbox/features/ui/containers/bundle_container';
import { import {
AdminNav,
LatestAccountsPanel, LatestAccountsPanel,
} from 'soapbox/features/ui/util/async-components'; } from 'soapbox/features/ui/util/async-components';
@ -22,10 +21,6 @@ const AdminPage: React.FC = ({ children }) => {
</Layout.Main> </Layout.Main>
<Layout.Aside> <Layout.Aside>
<BundleContainer fetchComponent={AdminNav}>
{Component => <Component />}
</BundleContainer>
<BundleContainer fetchComponent={LatestAccountsPanel}> <BundleContainer fetchComponent={LatestAccountsPanel}>
{Component => <Component limit={5} />} {Component => <Component limit={5} />}
</BundleContainer> </BundleContainer>