Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Jira
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
minerva
frontend
Commits
0f32e682
Commit
0f32e682
authored
10 months ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
toggle drawers instead of opening
parent
44813ef1
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!223
reset the pin numbers before search results are fetch (so the results will be...
,
!194
Resolve "[MIN-260] Expected to close Export and other tabs by clicking on the same icon"
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/FunctionalArea/NavBar/NavBar.component.tsx
+33
-14
33 additions, 14 deletions
src/components/FunctionalArea/NavBar/NavBar.component.tsx
with
33 additions
and
14 deletions
src/components/FunctionalArea/NavBar/NavBar.component.tsx
+
33
−
14
View file @
0f32e682
import
logoImg
from
'
@/assets/vectors/branding/logo.svg
'
;
import
luxembourgLogoImg
from
'
@/assets/vectors/branding/luxembourg-logo.svg
'
;
import
{
API_DOCS_URL
,
MINERVA_WEBSITE_URL
}
from
'
@/constants
'
;
import
{
openDrawer
}
from
'
@/redux/drawer/drawer.slice
'
;
import
{
closeDrawer
,
openDrawer
}
from
'
@/redux/drawer/drawer.slice
'
;
import
{
useAppDispatch
}
from
'
@/redux/hooks/useAppDispatch
'
;
import
{
openLegend
}
from
'
@/redux/legend/legend.slice
'
;
import
{
closeLegend
,
openLegend
}
from
'
@/redux/legend/legend.slice
'
;
import
{
openPluginsDrawer
}
from
'
@/redux/plugins/plugins.slice
'
;
import
{
IconButton
}
from
'
@/shared/IconButton
'
;
import
{
store
}
from
'
@/redux/store
'
;
...
...
@@ -13,21 +13,40 @@ import Image from 'next/image';
export
const
NavBar
=
():
JSX
.
Element
=>
{
const
dispatch
=
useAppDispatch
();
const
openDrawerInfo
=
():
void
=>
{
dispatch
(
openDrawer
(
'
project-info
'
));
const
toggleDrawerInfo
=
():
void
=>
{
if
(
store
.
getState
().
drawer
.
isOpen
&&
store
.
getState
().
drawer
.
drawerName
===
'
project-info
'
)
{
dispatch
(
closeDrawer
());
}
else
{
dispatch
(
openDrawer
(
'
project-info
'
));
}
};
const
openDrawerPlugins
=
():
void
=>
{
dispatch
(
openDrawer
(
'
available-plugins
'
));
const
toggleDrawerPlugins
=
():
void
=>
{
if
(
store
.
getState
().
drawer
.
isOpen
&&
store
.
getState
().
drawer
.
drawerName
===
'
available-plugins
'
)
{
dispatch
(
closeDrawer
());
}
else
{
dispatch
(
openDrawer
(
'
available-plugins
'
));
}
dispatch
(
openPluginsDrawer
());
};
const
openDrawerExport
=
():
void
=>
{
dispatch
(
openDrawer
(
'
export
'
));
const
toggleDrawerExport
=
():
void
=>
{
if
(
store
.
getState
().
drawer
.
isOpen
&&
store
.
getState
().
drawer
.
drawerName
===
'
export
'
)
{
dispatch
(
closeDrawer
());
}
else
{
dispatch
(
openDrawer
(
'
export
'
));
}
};
const
openDrawerLegend
=
():
void
=>
{
dispatch
(
openLegend
());
const
toggleDrawerLegend
=
():
void
=>
{
if
(
store
.
getState
().
legend
.
isOpen
)
{
dispatch
(
closeLegend
());
}
else
{
dispatch
(
openLegend
());
}
};
const
configuration
=
store
.
getState
().
configuration
.
main
.
data
;
...
...
@@ -37,15 +56,15 @@ export const NavBar = (): JSX.Element => {
<
div
className
=
"flex min-h-full w-[88px] flex-col items-center justify-between overflow-y-auto bg-cultured py-8"
>
<
div
data-testid
=
"nav-buttons"
>
<
div
className
=
"mb-8 flex flex-col gap-[10px]"
>
<
IconButton
icon
=
"info"
onClick
=
{
open
DrawerInfo
}
title
=
"Project info"
/>
<
IconButton
icon
=
"info"
onClick
=
{
toggle
DrawerInfo
}
title
=
"Project info"
/>
<
a
href
=
{
API_DOCS_URL
}
target
=
"_blank"
>
<
IconButton
icon
=
"page"
title
=
"API Doc"
/>
</
a
>
<
IconButton
icon
=
"plugin"
onClick
=
{
open
DrawerPlugins
}
title
=
"Available plugins"
/>
<
IconButton
icon
=
"export"
onClick
=
{
open
DrawerExport
}
title
=
"Export"
/>
<
IconButton
icon
=
"plugin"
onClick
=
{
toggle
DrawerPlugins
}
title
=
"Available plugins"
/>
<
IconButton
icon
=
"export"
onClick
=
{
toggle
DrawerExport
}
title
=
"Export"
/>
</
div
>
<
div
className
=
"flex flex-col gap-[10px]"
>
<
IconButton
icon
=
"legend"
onClick
=
{
open
DrawerLegend
}
title
=
"Legend"
/>
<
IconButton
icon
=
"legend"
onClick
=
{
toggle
DrawerLegend
}
title
=
"Legend"
/>
</
div
>
</
div
>
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment