Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
ESAP GUI
Manage
Activity
Members
Labels
Plan
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review 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
ASTRON SDC
ESCAPE WP5
ESAP GUI
Commits
eff56235
Commit
eff56235
authored
2 years ago
by
Klaas Kliffen
Browse files
Options
Downloads
Patches
Plain Diff
Fix issue with loading login data
parent
0454f8a3
No related branches found
No related tags found
1 merge request
!109
Clean up GUI part I
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/components/NavBar.js
+32
-24
32 additions, 24 deletions
src/components/NavBar.js
with
32 additions
and
24 deletions
src/components/NavBar.js
+
32
−
24
View file @
eff56235
import
React
,
{
useContext
}
from
"
react
"
;
import
{
useHistory
}
from
"
react-router-dom
"
;
import
{
Navbar
,
Nav
}
from
"
react-bootstrap
"
;
import
{
NavLink
}
from
"
react-router-dom
"
;
import
AuthControl
from
"
./auth/authControl
"
;
import
MyBasketButton
from
"
./basket/MyBasketButton
"
import
SaveBasketButton
from
"
./basket/SaveBasketButton
"
import
ShowTokenButton
from
"
./ShowTokenButton
"
import
{
QueryContext
}
from
"
../contexts/QueryContext
"
;
import
{
GlobalContext
}
from
"
../contexts/GlobalContext
"
;
import
React
,
{
useContext
,
useEffect
}
from
"
react
"
;
import
{
Nav
,
Navbar
}
from
"
react-bootstrap
"
;
import
{
NavLink
,
useHistory
}
from
"
react-router-dom
"
;
import
esap_logo
from
"
../assets/esap_logo.png
"
;
import
{
GlobalContext
}
from
"
../contexts/GlobalContext
"
;
import
{
QueryContext
}
from
"
../contexts/QueryContext
"
;
import
AuthControl
from
"
./auth/authControl
"
;
import
MyBasketButton
from
"
./basket/MyBasketButton
"
;
import
SaveBasketButton
from
"
./basket/SaveBasketButton
"
;
import
ShowTokenButton
from
"
./ShowTokenButton
"
;
export
default
function
NavBar
()
{
let
history
=
useHistory
()
// History is defined here; since this is the first component that
// is in the router
const
history
=
useHistory
();
const
{
navbar
,
refreshLogin
}
=
useContext
(
GlobalContext
);
const
{
config
}
=
useContext
(
QueryContext
);
if
(
!
navbar
)
return
null
;
if
(
!
config
)
return
null
;
const
{
navbar
,
refreshLogin
}
=
useContext
(
GlobalContext
);
// On Mount, check login once;
useEffect
(()
=>
{
refreshLogin
(
history
);
},
[]);
const
{
config
}
=
useContext
(
QueryContext
);
if
(
!
navbar
)
return
null
;
if
(
!
config
)
return
null
;
const
navlist
=
navbar
.
navbar
;
const
navlist
=
navbar
.
navbar
;
return
(
return
(
<
Navbar
bg
=
"
dark
"
variant
=
"
dark
"
>
<
img
alt
=
""
...
...
@@ -38,14 +46,14 @@ export default function NavBar() {
<
/Nav.Link
>
))}
<
/Nav
>
<
Nav
.
Link
key
=
"
my basket
"
as
=
{
NavLink
}
to
=
"
/basket
"
>
<
MyBasketButton
/>
<
/Nav.Link
>
<
SaveBasketButton
/>
{
'
'
}
<
Nav
.
Link
key
=
"
my basket
"
as
=
{
NavLink
}
to
=
"
/basket
"
>
<
MyBasketButton
/>
<
/Nav.Link
>
<
SaveBasketButton
/>
{
'
'
}
<
Nav
>
<
ShowTokenButton
/>
<
AuthControl
/>
<
ShowTokenButton
/>
<
AuthControl
/>
<
/Nav
>
<
/Navbar
>
);
);
}
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