Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
X
xpub-faraday
Manage
Activity
Members
Labels
Plan
Issues
2
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Container Registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
xpub
xpub-faraday
Commits
e5987057
Commit
e5987057
authored
7 years ago
by
Sebastian
Browse files
Options
Downloads
Plain Diff
Merge branch 'faraday-master' of gitlab.coko.foundation:xpub/xpub into faraday-master
parents
e7537aab
b47249f5
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
packages/components-faraday/src/components/AppBar/AppBar.js
+16
-3
16 additions, 3 deletions
packages/components-faraday/src/components/AppBar/AppBar.js
with
16 additions
and
3 deletions
packages/components-faraday/src/components/AppBar/AppBar.js
+
16
−
3
View file @
e5987057
import
React
from
'
react
'
import
{
Icon
}
from
'
@pubsweet/ui
'
import
{
get
}
from
'
lodash
'
import
styled
from
'
styled-components
'
import
{
withRouter
}
from
'
react-router-dom
'
import
{
withState
,
withHandlers
,
compose
}
from
'
recompose
'
...
...
@@ -13,7 +14,9 @@ const AppBar = ({ expanded, toggleMenu, brand, user, goTo }) => (
<
User
>
<
div
onClick
=
{
toggleMenu
}
>
<
Icon
color
=
"
#667080
"
>
user
<
/Icon
>
<
span
>
{
user
.
username
}
<
/span
>
<
span
>
{
get
(
user
,
'
firstName
'
)
||
get
(
user
,
'
username
'
)
||
'
User
'
}
<
/span
>
<
Icon
color
=
"
#667080
"
>
chevron
-
down
<
/Icon
>
<
/div
>
{
expanded
&&
(
...
...
@@ -22,11 +25,12 @@ const AppBar = ({ expanded, toggleMenu, brand, user, goTo }) => (
<
DropdownOption
onClick
=
{
goTo
(
'
admin
'
)}
>
Admin
dashboard
<
/DropdownOption
>
<
DropdownOption
>
Logout
<
/DropdownOption
>
<
DropdownOption
onClick
=
{
goTo
(
'
/logout
'
)}
>
Logout
<
/DropdownOption
>
<
/Dropdown
>
)}
<
/User
>
)}
{
expanded
&&
<
ToggleOverlay
onClick
=
{
toggleMenu
}
/>
}
<
/Root
>
)
...
...
@@ -87,6 +91,15 @@ const DropdownOption = styled.div`
}
`
const
ToggleOverlay
=
styled
.
div
`
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
opacity: 0;
`
export
default
compose
(
withRouter
,
withState
(
'
expanded
'
,
'
setExpanded
'
,
false
),
...
...
@@ -95,8 +108,8 @@ export default compose(
setExpanded
(
v
=>
!
v
)
},
goTo
:
({
setExpanded
,
history
})
=>
path
=>
()
=>
{
history
.
push
(
path
)
setExpanded
(
v
=>
false
)
history
.
push
(
path
)
},
}),
)(
AppBar
)
This diff is collapsed.
Click to expand it.
Preview
0%
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