some more task tab play

This commit is contained in:
jasquat 2022-11-11 10:28:08 -05:00
parent d3eb7ffdb2
commit 57ec4a31fc
2 changed files with 23 additions and 16 deletions

View File

@ -46545,7 +46545,7 @@
"@csstools/postcss-text-decoration-shorthand": "^1.0.0", "@csstools/postcss-text-decoration-shorthand": "^1.0.0",
"@csstools/postcss-trigonometric-functions": "^1.0.2", "@csstools/postcss-trigonometric-functions": "^1.0.2",
"@csstools/postcss-unset-value": "^1.0.2", "@csstools/postcss-unset-value": "^1.0.2",
"autoprefixer": "10.4.8", "autoprefixer": "10.4.5",
"browserslist": "^4.21.3", "browserslist": "^4.21.3",
"css-blank-pseudo": "^3.0.3", "css-blank-pseudo": "^3.0.3",
"css-has-pseudo": "^3.0.4", "css-has-pseudo": "^3.0.4",
@ -46583,7 +46583,8 @@
}, },
"dependencies": { "dependencies": {
"autoprefixer": { "autoprefixer": {
"version": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.5.tgz", "version": "10.4.5",
"resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.4.5.tgz",
"integrity": "sha512-Fvd8yCoA7lNX/OUllvS+aS1I7WRBclGXsepbvT8ZaPgrH24rgXpZzF0/6Hh3ZEkwg+0AES/Osd196VZmYoEFtw==", "integrity": "sha512-Fvd8yCoA7lNX/OUllvS+aS1I7WRBclGXsepbvT8ZaPgrH24rgXpZzF0/6Hh3ZEkwg+0AES/Osd196VZmYoEFtw==",
"requires": { "requires": {
"browserslist": "^4.20.2", "browserslist": "^4.20.2",

View File

@ -14,30 +14,36 @@ export default function HomePageRoutes() {
useEffect(() => { useEffect(() => {
setErrorMessage(null); setErrorMessage(null);
let newSelectedTabIndex = 0;
if (location.pathname.match(/^\/tasks\/\d/)) {
newSelectedTabIndex = 1;
}
setSelectedTabIndex(newSelectedTabIndex);
}, [location, setErrorMessage]); }, [location, setErrorMessage]);
// selectedIndex={selectedTabIndex}
// onChange={(event: any) => {
// setSelectedTabIndex(event.selectedIndex);
// }}
return ( return (
<> <>
<h1>HELO</h1> <Tabs
<Tabs> selectedIndex={selectedTabIndex}
onChange={(event: any) => {
setSelectedTabIndex(event.selectedIndex);
}}
>
<TabList aria-label="List of tabs"> <TabList aria-label="List of tabs">
<Tab onClick={() => navigate('http://www.google.com')}> <Tab onClick={() => navigate('/tasks/my-tasks')}>My Tasks</Tab>
Tab Label 1 <Tab
onClick={() =>
navigate('/tasks/9/4dc9f6e3-2256-47b2-9f78-6bc2f061db80')
}
>
One Task
</Tab> </Tab>
<Tab>Tab Label 2</Tab>
<Tab disabled>Tab Label 3</Tab>
<Tab title="Tab Label 4 with a very long long title">
Tab Label 4 with a very long long title
</Tab>
<Tab>Tab Label 5</Tab>
</TabList> </TabList>
</Tabs> </Tabs>
<br />
<Routes> <Routes>
<Route path="/" element={<MyTasks />} /> <Route path="/" element={<MyTasks />} />
<Route path="/my-tasks" element={<MyTasks />} />
<Route path=":process_instance_id/:task_id" element={<TaskShow />} /> <Route path=":process_instance_id/:task_id" element={<TaskShow />} />
</Routes> </Routes>
</> </>