Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
editoria
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Show more breadcrumbs
Yannis Barlas
editoria
Commits
5fbddd4e
Commit
5fbddd4e
authored
8 years ago
by
john
Browse files
Options
Downloads
Patches
Plain Diff
logout redirects you to /
parent
64022505
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
app/components/Navigation/Navigation.jsx
+28
-5
28 additions, 5 deletions
app/components/Navigation/Navigation.jsx
with
28 additions
and
5 deletions
app/components/Navigation/Navigation.jsx
+
28
−
5
View file @
5fbddd4e
import
React
from
'
react
'
import
React
from
'
react
'
import
{
browserHistory
}
from
'
react-router
'
import
{
LinkContainer
}
from
'
react-router-bootstrap
'
import
{
LinkContainer
}
from
'
react-router-bootstrap
'
import
{
Navbar
,
Nav
,
NavItem
,
NavbarBrand
}
from
'
react-bootstrap
'
import
{
Navbar
,
Nav
,
NavItem
,
NavbarBrand
}
from
'
react-bootstrap
'
...
@@ -6,39 +7,61 @@ import Authorize from 'pubsweet-frontend/src/helpers/Authorize'
...
@@ -6,39 +7,61 @@ import Authorize from 'pubsweet-frontend/src/helpers/Authorize'
import
NavbarUser
from
'
pubsweet-component-navigation/NavbarUser
'
import
NavbarUser
from
'
pubsweet-component-navigation/NavbarUser
'
export
default
class
Navigation
extends
React
.
Component
{
export
default
class
Navigation
extends
React
.
Component
{
constructor
(
props
)
{
super
(
props
)
this
.
logout
=
this
.
logout
.
bind
(
this
)
}
logout
()
{
const
{
logoutUser
}
=
this
.
props
.
actions
logoutUser
()
browserHistory
.
push
(
'
/
'
)
}
render
()
{
render
()
{
const
{
actions
,
currentUser
}
=
this
.
props
const
{
currentUser
}
=
this
.
props
let
logoutButtonIfAuthenticated
let
logoutButtonIfAuthenticated
if
(
currentUser
.
isAuthenticated
)
{
if
(
currentUser
.
isAuthenticated
)
{
logoutButtonIfAuthenticated
=
<
NavbarUser
logoutButtonIfAuthenticated
=
(
user
=
{
currentUser
.
user
}
<
NavbarUser
onLogoutClick
=
{
actions
.
logoutUser
}
user
=
{
currentUser
.
user
}
/>
onLogoutClick
=
{
this
.
logout
}
/>
)
}
}
// TODO -- fix object properties underneath
return
(
return
(
<
Navbar
fluid
>
<
Navbar
fluid
>
<
Navbar
.
Header
>
<
Navbar
.
Header
>
<
NavbarBrand
>
<
NavbarBrand
>
<
a
href
=
'#'
><
img
src
=
'/pubsweet.jpg'
alt
=
'pubsweet'
/></
a
>
<
a
href
=
'#'
><
img
src
=
'/pubsweet.jpg'
alt
=
'pubsweet'
/></
a
>
</
NavbarBrand
>
</
NavbarBrand
>
</
Navbar
.
Header
>
</
Navbar
.
Header
>
<
Nav
>
<
Nav
>
<
LinkContainer
to
=
'/books'
>
<
LinkContainer
to
=
'/books'
>
<
NavItem
>
Books
</
NavItem
>
<
NavItem
>
Books
</
NavItem
>
</
LinkContainer
>
</
LinkContainer
>
<
Authorize
operation
=
'read'
object
=
{
currentUser
.
user
}
>
<
Authorize
operation
=
'read'
object
=
{
currentUser
.
user
}
>
<
LinkContainer
to
=
'/users'
>
<
LinkContainer
to
=
'/users'
>
<
NavItem
>
Users
</
NavItem
>
<
NavItem
>
Users
</
NavItem
>
</
LinkContainer
>
</
LinkContainer
>
</
Authorize
>
</
Authorize
>
<
Authorize
operation
=
'read'
>
<
Authorize
operation
=
'read'
>
<
LinkContainer
to
=
'/teams'
>
<
LinkContainer
to
=
'/teams'
>
<
NavItem
>
Teams
</
NavItem
>
<
NavItem
>
Teams
</
NavItem
>
</
LinkContainer
>
</
LinkContainer
>
</
Authorize
>
</
Authorize
>
</
Nav
>
</
Nav
>
{
logoutButtonIfAuthenticated
}
{
logoutButtonIfAuthenticated
}
</
Navbar
>
</
Navbar
>
)
)
}
}
...
...
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