this.handleHeaderClick(e)}
onContextMenu={(e) => this.handleContextButtonClick(e)}
>
- {repository.name}
+
+ {repository.name}
}
@@ -186,6 +201,10 @@ class RepositorySection extends React.Component {
}
}
+RepositorySection.contextTypes = {
+ router: PropTypes.object
+}
+
RepositorySection.propTypes = {
repository: PropTypes.shape({
name: PropTypes.string,
@@ -193,7 +212,8 @@ RepositorySection.propTypes = {
name: PropTypes.string
}))
}),
- dispatch: PropTypes.func
+ dispatch: PropTypes.func,
+ isFolded: PropTypes.bool
}
export default CSSModules(RepositorySection, styles)
diff --git a/browser/main/HomePage/SideNav/RepositorySection.styl b/browser/main/HomePage/SideNav/RepositorySection.styl
index 649bf322..5f50f5cb 100644
--- a/browser/main/HomePage/SideNav/RepositorySection.styl
+++ b/browser/main/HomePage/SideNav/RepositorySection.styl
@@ -8,10 +8,28 @@
cursor pointer
color $nav-inactive-text-color
transition 0.15s
+ border none
+ width 100%
+ text-align left
+ background-color transparent
+ font-size 14px
&:hover
background-color $nav-hover-background
.header-control-button
opacity 1
+ &:active, &:active:hover
+ background-color $nav-active-background
+ color $nav-text-color
+
+.header--active
+ @extend .header
+ background-color $nav-active-background
+ color $nav-text-color
+ .header-control-button
+ opacity 1
+ &:hover
+ background-color $nav-active-background
+ color $nav-text-color
.header-name
position absolute
@@ -22,6 +40,9 @@
padding-left 10px
line-height 33px
+.header-name-label
+ margin-left 5px
+
.header-control
position absolute
top 0
@@ -39,7 +60,7 @@
background-color transparent
color $nav-inactive-text-color
opacity 0
- transition 0.15s
+ transition color background-color 0.15s
&:hover
background-color $nav-hover-background
&:active
@@ -75,9 +96,94 @@
text-align left
color $nav-inactive-text-color
background-color transparent
- transition 0.15s
+ transition color background-color 0.15s
&:hover
background-color $nav-hover-background
&:active
background-color $nav-active-background
color $nav-text-color
+
+.newFolderButton
+ height 34px
+ line-height 34px
+.newFolderButton-label
+ margin-left 0
+
+.root-folded
+ @extend .root
+ width 44px
+ .header, .header--active
+ width 44px
+ text-align center
+ overflow hidden
+ &:hover
+ .header-name-label
+ width 134px
+ padding-left 34px
+ .header-control
+ width 35px
+ padding-right 5px
+ .header-name
+ width 44px
+ padding-left 0
+ .header-name-label
+ position fixed
+ display inline-block
+ height 34px
+ left 44px
+ width 0
+ box-sizing border-box
+ margin-left 0
+ overflow ellipsis
+ background-color $nav-tooltip-background-color
+ color white
+ line-height 34px
+ border-top-right-radius 5px
+ border-bottom-right-radius 5px
+ transition width 0.15s
+ pointer-events none
+ .header-control
+ position fixed
+ width 0
+ height 33px
+ top inherit
+ bottom inherit
+ left 43px
+ box-sizing border-box
+ overflow hidden
+ .header-control-button
+ display none
+ .header-control-button--show
+ float right
+ background-color $nav-tooltip-button-background
+ &:hover
+ background-color $nav-tooltip-button-background--hover
+ .newFolderButton
+ width 44px
+ padding 0
+ &:hover .newFolderButton-label
+ width 100px
+ .newFolderButton-icon
+ text-align center
+ width 44px
+ .newFolderButton-label
+ position fixed
+ display inline-block
+ height 34px
+ left 44px
+ width 0
+ box-sizing border-box
+ margin-left 0
+ overflow ellipsis
+ background-color $nav-tooltip-background-color
+ color white
+ line-height 34px
+ border-top-right-radius 5px
+ border-bottom-right-radius 5px
+ transition width 0.15s
+ pointer-events none
+ font-size 14px
+ text-align center
+ .newFolderForm-nameInput
+ position fixed
+ width 100px
diff --git a/browser/main/HomePage/SideNav/SideNav.styl b/browser/main/HomePage/SideNav/SideNav.styl
index 6b416d1f..c9bd6592 100644
--- a/browser/main/HomePage/SideNav/SideNav.styl
+++ b/browser/main/HomePage/SideNav/SideNav.styl
@@ -11,39 +11,26 @@
border-bottom solid 1px $nav-border-color
.top-menu
+ navButtonColor()
height 59px
padding 0 10px
font-size 14px
width 100%
text-align left
- border none
- color $nav-inactive-text-color
- background-color transparent
- transition 0.15s
- &:hover
- background-color $nav-hover-background
- &:active
- background-color $nav-active-background
- color $nav-text-color
+
+.top-menu-label
+ margin-left 5px
.menu
margin-top 15px
.menu-button
+ navButtonColor()
height 44px
padding 0 10px
font-size 14px
width 100%
text-align left
- border none
- color $nav-inactive-text-color
- background-color transparent
- transition 0.15s
- &:hover
- background-color $nav-hover-background
- &:active
- background-color $nav-active-background
- color $nav-text-color
.menu-button--active
@extend .menu-button
@@ -52,6 +39,9 @@
&:hover
background-color $nav-active-background
+.menu-button-label
+ margin-left 5px
+
.repositoryList
absolute left right bottom
top 178px
@@ -74,10 +64,57 @@
color $nav-inactive-text-color
border none
background-color transparent
- transition 0.15s
+ transition color background-color 0.15s
&:hover
background-color $nav-hover-background
color $nav-inactive-text-color
&:active
background-color $nav-active-background
color $nav-text-color
+
+.root-folded
+ @extend .root
+ width 44px
+ .top-menu
+ width 44px
+ text-align center
+ &:hover .top-menu-label
+ width 100px
+ .top-menu-label
+ position fixed
+ display inline-block
+ height 34px
+ left 44px
+ width 0
+ margin-top -5px
+ margin-left 0
+ overflow hidden
+ background-color $nav-tooltip-background-color
+ color white
+ line-height 34px
+ border-top-right-radius 5px
+ border-bottom-right-radius 5px
+ transition width 0.15s
+ pointer-events none
+ .menu-button, .menu-button--active
+ width 44px
+ text-align center
+ &:hover .menu-button-label
+ width 100px
+ .menu-button-label
+ position fixed
+ display inline-block
+ height 34px
+ left 44px
+ width 0
+ padding-left 0
+ margin-top -9px
+ margin-left 0
+ overflow ellipsis
+ background-color $nav-tooltip-background-color
+ color white
+ line-height 34px
+ border-top-right-radius 5px
+ border-bottom-right-radius 5px
+ transition width 0.15s
+ pointer-events none
diff --git a/browser/main/HomePage/SideNav/index.js b/browser/main/HomePage/SideNav/index.js
index 373c1677..dc21d019 100644
--- a/browser/main/HomePage/SideNav/index.js
+++ b/browser/main/HomePage/SideNav/index.js
@@ -24,7 +24,7 @@ class SideNav extends React.Component {
label: 'Mount Repository',
click: (e) => this.handleNewRepositoryButtonClick(e)
}))
- menu.popup(remote.getCurrentWindow())
+ menu.popup(remote.getCurrentWindow(), e.clientX, e.clientY - 44)
}
handleNewRepositoryButtonClick (e) {
@@ -45,29 +45,43 @@ class SideNav extends React.Component {
router.push('/starred')
}
- render () {
- let { repositories, dispatch, location } = this.props
- let repositorieElements = repositories.map((repo) => {
- return
+ handleToggleButtonClick (e) {
+ let { dispatch } = this.props
+
+ dispatch({
+ type: 'TOGGLE_SIDENAV'
})
+ }
+
+ render () {
+ let { repositories, dispatch, location, status } = this.props
+
+ let isFolded = !status.sideNavExpand
let isHomeActive = location.pathname.match(/^\/home$/)
let isStarredActive = location.pathname.match(/^\/starred$/)
+ let repositorieElements = repositories
+ .map((repo) => {
+ return
+ })
+
return (
this.handleMenuButtonClick(e)}
>
- Menu
+
+ Menu
@@ -75,12 +89,18 @@ class SideNav extends React.Component {
this.handleHomeButtonClick(e)}
>
- Home
+
+ Home
this.handleStarredButtonClick(e)}
>
- Starred
+
+ Starred
@@ -90,8 +110,13 @@ class SideNav extends React.Component {
)}