diff --git a/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx b/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx
index 6e3a4a0a36..612a596db6 100644
--- a/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx
+++ b/src/frontend/src/pages/Index/Settings/AdminCenter/Index.tsx
@@ -1,14 +1,5 @@
-import { Trans, t } from '@lingui/macro';
-import {
- Divider,
- Flex,
- Paper,
- SimpleGrid,
- Skeleton,
- Stack,
- Text,
- Title
-} from '@mantine/core';
+import { t } from '@lingui/macro';
+import { Divider, Skeleton, Stack } from '@mantine/core';
import {
IconCoins,
IconCpu,
@@ -27,16 +18,15 @@ import {
IconUsersGroup
} from '@tabler/icons-react';
import { lazy, useMemo } from 'react';
-import { useNavigate } from 'react-router-dom';
+import { useLocation, useNavigate } from 'react-router-dom';
-import { ActionButton } from '../../../../components/buttons/ActionButton';
import PermissionDenied from '../../../../components/errors/PermissionDenied';
-import { PlaceholderPill } from '../../../../components/items/Placeholder';
import { PanelGroup, PanelType } from '../../../../components/nav/PanelGroup';
import { SettingsHeader } from '../../../../components/nav/SettingsHeader';
import { GlobalSettingList } from '../../../../components/settings/SettingList';
import { Loadable } from '../../../../functions/loading';
import { useUserState } from '../../../../states/UserState';
+import { generateQuickAction } from './generateQuickAction';
const ReportTemplatePanel = Loadable(
lazy(() => import('./ReportTemplatePanel'))
@@ -97,7 +87,16 @@ const CurrencyTable = Loadable(
export default function AdminCenter() {
const user = useUserState();
const navigate = useNavigate();
+ const location = useLocation();
+ const panel = useMemo(() => {
+ return location.pathname.replace('/settings/admin/', '');
+ }, [location.pathname]);
+ const showQuickAction: boolean = useMemo(() => {
+ return panel !== 'home';
+ }, [panel]);
+
+ const QuickAction = generateQuickAction(navigate);
const adminCenterPanels: PanelType[] = useMemo(() => {
return [
{
@@ -200,41 +199,6 @@ export default function AdminCenter() {
];
}, []);
- const QuickAction = () => (
-
-
- Quick Actions
-
-
- }
- color="blue"
- size="lg"
- radius="sm"
- variant="filled"
- tooltip={t`Go to Home`}
- onClick={() => navigate('home')}
- />
-
-
-
-
- Add a new user
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-
if (!user.isLoggedIn()) {
return ;
}
@@ -249,7 +213,7 @@ export default function AdminCenter() {
switch_link="/settings/system"
switch_text="System Settings"
/>
-
+ {showQuickAction ? : null}
(
+
+
+ Quick Actions
+
+
+ }
+ color="blue"
+ size="lg"
+ radius="sm"
+ variant="filled"
+ tooltip={t`Go to Home`}
+ onClick={() => navigate('home')}
+ />
+
+
+
+
+ Add a new user
+
+
+
+
+
+
+
+
+
+
+
+
+
+ );
+}