From 43af6fdaba133f361c348bf6160e0b520d5f3113 Mon Sep 17 00:00:00 2001 From: Alejandro Celaya Date: Tue, 8 Dec 2020 18:27:36 +0100 Subject: [PATCH] Added redirect from server base path to overview page, to ease changing default page --- src/common/MenuLayout.tsx | 3 ++- src/servers/CreateServer.tsx | 2 +- src/servers/EditServer.tsx | 2 +- src/servers/ServersDropdown.tsx | 2 +- src/servers/ServersListGroup.tsx | 2 +- 5 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/common/MenuLayout.tsx b/src/common/MenuLayout.tsx index b87010f0..697b3830 100644 --- a/src/common/MenuLayout.tsx +++ b/src/common/MenuLayout.tsx @@ -1,5 +1,5 @@ import { FC, useEffect } from 'react'; -import { Route, Switch } from 'react-router-dom'; +import { Redirect, Route, Switch } from 'react-router-dom'; import { useSwipeable } from 'react-swipeable'; import { faBars as burgerIcon } from '@fortawesome/free-solid-svg-icons'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; @@ -61,6 +61,7 @@ const MenuLayout = (
hideSidebar()}>
+ diff --git a/src/servers/CreateServer.tsx b/src/servers/CreateServer.tsx index d17621d3..ab0e2d5c 100644 --- a/src/servers/CreateServer.tsx +++ b/src/servers/CreateServer.tsx @@ -39,7 +39,7 @@ const CreateServer = (ImportServersBtn: FC, useStateFlagT const id = uuid(); createServer({ ...serverData, id }); - push(`/server/${id}/overview`); + push(`/server/${id}`); }; return ( diff --git a/src/servers/EditServer.tsx b/src/servers/EditServer.tsx index 1b1db461..d8871748 100644 --- a/src/servers/EditServer.tsx +++ b/src/servers/EditServer.tsx @@ -18,7 +18,7 @@ export const EditServer = (ServerError: FC) => withSelectedServer { editServer(selectedServer.id, serverData); - push(`/server/${selectedServer.id}/overview`); + push(`/server/${selectedServer.id}`); }; return ( diff --git a/src/servers/ServersDropdown.tsx b/src/servers/ServersDropdown.tsx index 67f0d97f..a787c467 100644 --- a/src/servers/ServersDropdown.tsx +++ b/src/servers/ServersDropdown.tsx @@ -23,7 +23,7 @@ const ServersDropdown = (serversExporter: ServersExporter) => ({ servers, select {name} diff --git a/src/servers/ServersListGroup.tsx b/src/servers/ServersListGroup.tsx index d96e0762..ec0f1454 100644 --- a/src/servers/ServersListGroup.tsx +++ b/src/servers/ServersListGroup.tsx @@ -11,7 +11,7 @@ interface ServersListGroup { } const ServerListItem = ({ id, name }: { id: string; name: string }) => ( - + {name}