From 60f54f80b0c26af4a2558f2486c0c75adf4fa6ae Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Sat, 17 Dec 2022 15:08:59 -0600 Subject: [PATCH] Dashboard: add quick links to Soapbox Config and Moderation Log --- app/soapbox/features/admin/tabs/dashboard.tsx | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/app/soapbox/features/admin/tabs/dashboard.tsx b/app/soapbox/features/admin/tabs/dashboard.tsx index 40e1bd4fb..6b7de2747 100644 --- a/app/soapbox/features/admin/tabs/dashboard.tsx +++ b/app/soapbox/features/admin/tabs/dashboard.tsx @@ -1,5 +1,6 @@ import React from 'react'; import { FormattedMessage } from 'react-intl'; +import { useHistory } from 'react-router-dom'; import { getSubscribersCsv, getUnsubscribersCsv, getCombinedCsv } from 'soapbox/actions/email-list'; import List, { ListItem } from 'soapbox/components/list'; @@ -14,6 +15,7 @@ import RegistrationModePicker from '../components/registration-mode-picker'; const Dashboard: React.FC = () => { const dispatch = useAppDispatch(); + const history = useHistory(); const instance = useInstance(); const features = useFeatures(); const account = useOwnAccount(); @@ -39,6 +41,9 @@ const Dashboard: React.FC = () => { e.preventDefault(); }; + const navigateToSoapboxConfig = () => history.push('/soapbox/config'); + const navigateToModerationLog = () => history.push('/soapbox/admin/log'); + const v = parseVersion(instance.version); const userCount = instance.stats.get('user_count'); @@ -78,6 +83,20 @@ const Dashboard: React.FC = () => { /> + + {account.admin && ( + } + /> + )} + + } + /> + + {account.admin && ( <>