removed tabs from taskshow page w/ burnettk cullerton
This commit is contained in:
parent
6d782278e5
commit
9c08e70d6a
|
@ -28,21 +28,32 @@ export default function HomePageRoutes() {
|
||||||
setSelectedTabIndex(newSelectedTabIndex);
|
setSelectedTabIndex(newSelectedTabIndex);
|
||||||
}, [location, setErrorMessage]);
|
}, [location, setErrorMessage]);
|
||||||
|
|
||||||
|
const renderTabs = () => {
|
||||||
|
if (location.pathname.match(/^\/tasks\/\d+\/\b/)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return (
|
||||||
|
<>
|
||||||
|
<Tabs selectedIndex={selectedTabIndex}>
|
||||||
|
<TabList aria-label="List of tabs">
|
||||||
|
<Tab onClick={() => navigate('/tasks/my-tasks')}>My Tasks</Tab>
|
||||||
|
<Tab onClick={() => navigate('/tasks/grouped')}>Grouped Tasks</Tab>
|
||||||
|
<Tab onClick={() => navigate('/tasks/completed-instances')}>
|
||||||
|
Completed Instances
|
||||||
|
</Tab>
|
||||||
|
<Tab onClick={() => navigate('/tasks/create-new-instance')}>
|
||||||
|
Create New Instance +
|
||||||
|
</Tab>
|
||||||
|
</TabList>
|
||||||
|
</Tabs>
|
||||||
|
<br />
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Tabs selectedIndex={selectedTabIndex}>
|
{renderTabs()}
|
||||||
<TabList aria-label="List of tabs">
|
|
||||||
<Tab onClick={() => navigate('/tasks/my-tasks')}>My Tasks</Tab>
|
|
||||||
<Tab onClick={() => navigate('/tasks/grouped')}>Grouped Tasks</Tab>
|
|
||||||
<Tab onClick={() => navigate('/tasks/completed-instances')}>
|
|
||||||
Completed Instances
|
|
||||||
</Tab>
|
|
||||||
<Tab onClick={() => navigate('/tasks/create-new-instance')}>
|
|
||||||
Create New Instance +
|
|
||||||
</Tab>
|
|
||||||
</TabList>
|
|
||||||
</Tabs>
|
|
||||||
<br />
|
|
||||||
<Routes>
|
<Routes>
|
||||||
<Route path="/" element={<MyTasks />} />
|
<Route path="/" element={<MyTasks />} />
|
||||||
<Route path="my-tasks" element={<MyTasks />} />
|
<Route path="my-tasks" element={<MyTasks />} />
|
||||||
|
|
Loading…
Reference in New Issue