mirror of
https://github.com/BoostIo/Boostnote
synced 2025-12-13 17:56:25 +00:00
add redirect home -> user(current user), enhance UserNavigation style
This commit is contained in:
@@ -7,7 +7,7 @@ export default class UserNavigator extends Component {
|
|||||||
renderUserList () {
|
renderUserList () {
|
||||||
var users = this.props.users.map((user, index) => (
|
var users = this.props.users.map((user, index) => (
|
||||||
<li key={'user-' + user.id}>
|
<li key={'user-' + user.id}>
|
||||||
<Link to={'/users/' + user.id}>
|
<Link to={'/users/' + user.id} activeClassName='active'>
|
||||||
<ProfileImage email={user.email} size='44'/>
|
<ProfileImage email={user.email} size='44'/>
|
||||||
<div className='userTooltip'>{user.name}</div>
|
<div className='userTooltip'>{user.name}</div>
|
||||||
<div className='keyLabel'>{'⌘' + (index + 1)}</div>
|
<div className='keyLabel'>{'⌘' + (index + 1)}</div>
|
||||||
@@ -26,6 +26,10 @@ export default class UserNavigator extends Component {
|
|||||||
return (
|
return (
|
||||||
<div className='UserNavigator'>
|
<div className='UserNavigator'>
|
||||||
{this.renderUserList()}
|
{this.renderUserList()}
|
||||||
|
<button className='createTeamBtn'>
|
||||||
|
+
|
||||||
|
<div className='tooltip'>Create a new team</div>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -14,11 +14,11 @@ require('../styles/main/index.styl')
|
|||||||
function onlyUser (state, replaceState) {
|
function onlyUser (state, replaceState) {
|
||||||
var currentUser = JSON.parse(localStorage.getItem('currentUser'))
|
var currentUser = JSON.parse(localStorage.getItem('currentUser'))
|
||||||
if (currentUser == null) replaceState('login', '/login')
|
if (currentUser == null) replaceState('login', '/login')
|
||||||
|
if (state.location.pathname === '/') replaceState('user', '/users/' + currentUser.id)
|
||||||
}
|
}
|
||||||
|
|
||||||
let routes = (
|
let routes = (
|
||||||
<Route path='/' component={MainContainer}>
|
<Route path='/' component={MainContainer}>
|
||||||
|
|
||||||
<Route name='login' path='login' component={LoginContainer}/>
|
<Route name='login' path='login' component={LoginContainer}/>
|
||||||
<Route name='signup' path='signup' component={SignupContainer}/>
|
<Route name='signup' path='signup' component={SignupContainer}/>
|
||||||
<IndexRoute name='home' component={HomeContainer} onEnter={onlyUser}/>
|
<IndexRoute name='home' component={HomeContainer} onEnter={onlyUser}/>
|
||||||
@@ -27,11 +27,11 @@ let routes = (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// with Dev
|
// with Dev
|
||||||
import { compose } from 'redux'
|
// import { compose } from 'redux'
|
||||||
// Redux DevTools store enhancers
|
// // Redux DevTools store enhancers
|
||||||
import { devTools, persistState } from 'redux-devtools'
|
// import { devTools, persistState } from 'redux-devtools'
|
||||||
// React components for Redux DevTools
|
// // React components for Redux DevTools
|
||||||
import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'
|
// import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'
|
||||||
|
|
||||||
// let finalCreateStore = compose(devTools(), persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)))(createStore)
|
// let finalCreateStore = compose(devTools(), persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)))(createStore)
|
||||||
// let store = finalCreateStore(reducer)
|
// let store = finalCreateStore(reducer)
|
||||||
|
|||||||
7
browser/styles/main/HomeContainer/ArticleNavigator.styl
Normal file
7
browser/styles/main/HomeContainer/ArticleNavigator.styl
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
articleNavBgColor = #353535
|
||||||
|
|
||||||
|
.ArticleNavigator
|
||||||
|
background-color articleNavBgColor
|
||||||
|
absolute top bottom
|
||||||
|
left 60px
|
||||||
|
width 200px
|
||||||
@@ -27,59 +27,55 @@ userAnchorActiveBgColor = white
|
|||||||
font-size 1.1em
|
font-size 1.1em
|
||||||
cursor pointer
|
cursor pointer
|
||||||
transition 0.1s
|
transition 0.1s
|
||||||
opacity 0.8
|
|
||||||
|
|
||||||
img.ProfileImage
|
img.ProfileImage
|
||||||
width 38px
|
width 38px
|
||||||
height 38px
|
height 38px
|
||||||
border-radius 22px
|
border-radius 22px
|
||||||
&:hover, &.active
|
opacity 0.7
|
||||||
opacity 1
|
&:hover
|
||||||
|
img.ProfileImage
|
||||||
|
opacity 1
|
||||||
.userTooltip
|
.userTooltip
|
||||||
opacity 1
|
opacity 1
|
||||||
|
&.active
|
||||||
|
img.ProfileImage
|
||||||
|
opacity 1
|
||||||
.userTooltip
|
.userTooltip
|
||||||
|
tooltip()
|
||||||
position absolute
|
position absolute
|
||||||
z-index popupZIndex
|
|
||||||
background-color transparentify(invBackgroundColor, 80%)
|
|
||||||
color invTextColorq
|
|
||||||
padding 10px
|
|
||||||
line-height 1em
|
|
||||||
border-radius 5px
|
|
||||||
margin-top -52px
|
margin-top -52px
|
||||||
margin-left 52px
|
margin-left 44px
|
||||||
white-space nowrap
|
|
||||||
opacity 0
|
|
||||||
transition 0.1s
|
|
||||||
pointer-events none
|
|
||||||
.keyLabel
|
.keyLabel
|
||||||
margin-top -25px
|
margin-top -25px
|
||||||
font-size 0.8em
|
font-size 0.8em
|
||||||
color userNavigatorColor
|
color userNavigatorColor
|
||||||
button.newTeamButton
|
button.createTeamBtn
|
||||||
display block
|
display block
|
||||||
margin 0 auto
|
margin 0 auto
|
||||||
width 30px
|
width 30px
|
||||||
height 30px
|
height 30px
|
||||||
circle()
|
border-radius 15px
|
||||||
border solid 1px lightButtonColor
|
border 2px solid darken(white, 5%)
|
||||||
color lightButtonColor
|
color darken(white, 5%)
|
||||||
text-align center
|
text-align center
|
||||||
background-image none
|
background-image none
|
||||||
background-color transparent
|
background-color transparent
|
||||||
box-sizing border-box
|
box-sizing border-box
|
||||||
absolute left bottom right
|
absolute left right
|
||||||
bottom 15px
|
bottom 15px
|
||||||
&:hover, &.hover, &:focus, &.focus
|
font-size 22px
|
||||||
border-color darken(lightButtonColor, 50%)
|
line-height 22px
|
||||||
color darken(lightButtonColor, 50%)
|
transition 0.1s
|
||||||
&:active, &.active
|
|
||||||
border-color darken(brandBorderColor, 10%)
|
|
||||||
background-color brandColor
|
|
||||||
color white
|
|
||||||
.tooltip
|
.tooltip
|
||||||
tooltip()
|
tooltip()
|
||||||
margin-top -22px
|
margin-top -26px
|
||||||
margin-left 33px
|
margin-left 30px
|
||||||
font-size 14px
|
&:hover, &.hover, &:focus, &.focus
|
||||||
&:hover .tooltip
|
color white
|
||||||
opacity 1
|
border-color white
|
||||||
|
.tooltip
|
||||||
|
opacity 1
|
||||||
|
&:active
|
||||||
|
background-color brandColor
|
||||||
|
border-color brandColor
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
@import './UserNavigator'
|
@import './UserNavigator'
|
||||||
@import './ArticleTopBar'
|
@import './ArticleTopBar'
|
||||||
|
@import './ArticleNavigator'
|
||||||
@import './ArticleList'
|
@import './ArticleList'
|
||||||
@import './ArticleDetail'
|
@import './ArticleDetail'
|
||||||
|
|||||||
@@ -3,10 +3,9 @@ tooltip()
|
|||||||
z-index popupZIndex
|
z-index popupZIndex
|
||||||
background-color transparentify(invBackgroundColor, 80%)
|
background-color transparentify(invBackgroundColor, 80%)
|
||||||
color invTextColor
|
color invTextColor
|
||||||
padding 10px
|
padding 10px 15px
|
||||||
font-size 12px
|
font-size 12px
|
||||||
line-height 12px
|
line-height 12px
|
||||||
border-radius 5px
|
|
||||||
white-space nowrap
|
white-space nowrap
|
||||||
opacity 0
|
opacity 0
|
||||||
transition 0.1s
|
transition 0.1s
|
||||||
|
|||||||
Reference in New Issue
Block a user