|
@@ -1,6 +1,7 @@
|
1
|
1
|
import React from 'react'
|
2
|
2
|
import { connect } from 'react-redux'
|
3
|
3
|
import { withRouter } from 'react-router'
|
|
4
|
+import classnames from 'classnames'
|
4
|
5
|
import { translate } from 'react-i18next'
|
5
|
6
|
import WorkspaceListItem from '../component/Sidebar/WorkspaceListItem.jsx'
|
6
|
7
|
import { getWorkspaceList } from '../action-creator.async.js'
|
|
@@ -14,6 +15,7 @@ class Sidebar extends React.Component {
|
14
|
15
|
constructor (props) {
|
15
|
16
|
super(props)
|
16
|
17
|
this.state = {
|
|
18
|
+ sidebarClose: false,
|
17
|
19
|
workspaceIdInUrl: parseInt(props.match.params.idws)
|
18
|
20
|
}
|
19
|
21
|
}
|
|
@@ -55,12 +57,18 @@ class Sidebar extends React.Component {
|
55
|
57
|
history.push(`${PAGE_NAME.WS_CONTENT}/${wsId}/${filterList.join(';')}`) // workspace.filter gets updated on react redraw from match.params
|
56
|
58
|
}
|
57
|
59
|
|
|
60
|
+ handleClickToggleSidebar = () => this.setState(prev => ({sidebarClose: !prev.sidebarClose}))
|
|
61
|
+
|
58
|
62
|
render () {
|
59
|
|
- const { workspaceIdInUrl } = this.state
|
|
63
|
+ const { sidebarClose, workspaceIdInUrl } = this.state
|
60
|
64
|
const { activeLang, workspace, workspaceList, app, t } = this.props
|
61
|
65
|
|
62
|
66
|
return (
|
63
|
|
- <div className='sidebar d-none d-lg-block'>
|
|
67
|
+ <div className={classnames('sidebar d-none d-lg-block', {'sidebarclose': sidebarClose})}>
|
|
68
|
+ <div className='sidebar__expand' onClick={this.handleClickToggleSidebar}>
|
|
69
|
+ <i className={classnames('fa fa-fw', {'fa-plus-square-o': sidebarClose, 'fa-minus-square-o': !sidebarClose})} />
|
|
70
|
+ </div>
|
|
71
|
+
|
64
|
72
|
<nav className='sidebar__navigation'>
|
65
|
73
|
<ul className='sidebar__navigation__workspace'>
|
66
|
74
|
{ workspaceList.map((ws, i) =>
|