Skip to content

Commit acdf61f

Browse files
committed
add redirect home -> user(current user), enhance UserNavigation style
1 parent 2e4fc55 commit acdf61f

6 files changed

Lines changed: 47 additions & 40 deletions

File tree

browser/main/HomeContainer/Components/UserNavigator.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export default class UserNavigator extends Component {
77
renderUserList () {
88
var users = this.props.users.map((user, index) => (
99
<li key={'user-' + user.id}>
10-
<Link to={'/users/' + user.id}>
10+
<Link to={'/users/' + user.id} activeClassName='active'>
1111
<ProfileImage email={user.email} size='44'/>
1212
<div className='userTooltip'>{user.name}</div>
1313
<div className='keyLabel'>{'⌘' + (index + 1)}</div>
@@ -26,6 +26,10 @@ export default class UserNavigator extends Component {
2626
return (
2727
<div className='UserNavigator'>
2828
{this.renderUserList()}
29+
<button className='createTeamBtn'>
30+
+
31+
<div className='tooltip'>Create a new team</div>
32+
</button>
2933
</div>
3034
)
3135
}

browser/main/index.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ require('../styles/main/index.styl')
1414
function onlyUser (state, replaceState) {
1515
var currentUser = JSON.parse(localStorage.getItem('currentUser'))
1616
if (currentUser == null) replaceState('login', '/login')
17+
if (state.location.pathname === '/') replaceState('user', '/users/' + currentUser.id)
1718
}
1819

1920
let routes = (
2021
<Route path='/' component={MainContainer}>
21-
2222
<Route name='login' path='login' component={LoginContainer}/>
2323
<Route name='signup' path='signup' component={SignupContainer}/>
2424
<IndexRoute name='home' component={HomeContainer} onEnter={onlyUser}/>
@@ -27,11 +27,11 @@ let routes = (
2727
)
2828

2929
// with Dev
30-
import { compose } from 'redux'
31-
// Redux DevTools store enhancers
32-
import { devTools, persistState } from 'redux-devtools'
33-
// React components for Redux DevTools
34-
import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'
30+
// import { compose } from 'redux'
31+
// // Redux DevTools store enhancers
32+
// import { devTools, persistState } from 'redux-devtools'
33+
// // React components for Redux DevTools
34+
// import { DevTools, DebugPanel, LogMonitor } from 'redux-devtools/lib/react'
3535

3636
// let finalCreateStore = compose(devTools(), persistState(window.location.href.match(/[?&]debug_session=([^&]+)\b/)))(createStore)
3737
// let store = finalCreateStore(reducer)
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
articleNavBgColor = #353535
2+
3+
.ArticleNavigator
4+
background-color articleNavBgColor
5+
absolute top bottom
6+
left 60px
7+
width 200px

browser/styles/main/HomeContainer/UserNavigator.styl

Lines changed: 27 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -27,59 +27,55 @@ userAnchorActiveBgColor = white
2727
font-size 1.1em
2828
cursor pointer
2929
transition 0.1s
30-
opacity 0.8
3130

3231
img.ProfileImage
3332
width 38px
3433
height 38px
3534
border-radius 22px
36-
&:hover, &.active
37-
opacity 1
35+
opacity 0.7
36+
&:hover
37+
img.ProfileImage
38+
opacity 1
3839
.userTooltip
3940
opacity 1
41+
&.active
42+
img.ProfileImage
43+
opacity 1
4044
.userTooltip
45+
tooltip()
4146
position absolute
42-
z-index popupZIndex
43-
background-color transparentify(invBackgroundColor, 80%)
44-
color invTextColorq
45-
padding 10px
46-
line-height 1em
47-
border-radius 5px
4847
margin-top -52px
49-
margin-left 52px
50-
white-space nowrap
51-
opacity 0
52-
transition 0.1s
53-
pointer-events none
48+
margin-left 44px
5449
.keyLabel
5550
margin-top -25px
5651
font-size 0.8em
5752
color userNavigatorColor
58-
button.newTeamButton
53+
button.createTeamBtn
5954
display block
6055
margin 0 auto
6156
width 30px
6257
height 30px
63-
circle()
64-
border solid 1px lightButtonColor
65-
color lightButtonColor
58+
border-radius 15px
59+
border 2px solid darken(white, 5%)
60+
color darken(white, 5%)
6661
text-align center
6762
background-image none
6863
background-color transparent
6964
box-sizing border-box
70-
absolute left bottom right
65+
absolute left right
7166
bottom 15px
72-
&:hover, &.hover, &:focus, &.focus
73-
border-color darken(lightButtonColor, 50%)
74-
color darken(lightButtonColor, 50%)
75-
&:active, &.active
76-
border-color darken(brandBorderColor, 10%)
77-
background-color brandColor
78-
color white
67+
font-size 22px
68+
line-height 22px
69+
transition 0.1s
7970
.tooltip
8071
tooltip()
81-
margin-top -22px
82-
margin-left 33px
83-
font-size 14px
84-
&:hover .tooltip
85-
opacity 1
72+
margin-top -26px
73+
margin-left 30px
74+
&:hover, &.hover, &:focus, &.focus
75+
color white
76+
border-color white
77+
.tooltip
78+
opacity 1
79+
&:active
80+
background-color brandColor
81+
border-color brandColor
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
@import './UserNavigator'
22
@import './ArticleTopBar'
3+
@import './ArticleNavigator'
34
@import './ArticleList'
45
@import './ArticleDetail'

browser/styles/mixins/tooltip.styl

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ tooltip()
33
z-index popupZIndex
44
background-color transparentify(invBackgroundColor, 80%)
55
color invTextColor
6-
padding 10px
6+
padding 10px 15px
77
font-size 12px
88
line-height 12px
9-
border-radius 5px
109
white-space nowrap
1110
opacity 0
1211
transition 0.1s

0 commit comments

Comments
 (0)