瀏覽代碼

added sidebar (wip) + begin integration of thread (chat)

Skylsmoi 6 年之前
父節點
當前提交
a8f87b75db

+ 208 - 0
src/component/Sidebar/WorkspaceListItem.jsx 查看文件

@@ -0,0 +1,208 @@
1
+import React from 'react'
2
+// import classnames from 'classnames'
3
+import PropTypes from 'prop-types'
4
+
5
+const WorkspaceListItem = props => {
6
+  const handleClickTitle = () => {
7
+    props.onClickTitle()
8
+    const subMenuElement = document.getElementById(`sidebarSubMenu_${props.number}`)
9
+
10
+    if (props.isOpen) {
11
+      subMenuElement.style.height = '0px'
12
+    } else {
13
+      subMenuElement.style.height = 'auto'
14
+      const autoHeight = subMenuElement.offsetHeight + 'px'
15
+
16
+      subMenuElement.style.height = '0px'
17
+      // the setTimeout ensure that the line bellow is executed right after previous has ended
18
+      setTimeout(() => { subMenuElement.style.height = autoHeight }, 1)
19
+    }
20
+  }
21
+
22
+  const pad = number => {
23
+    number = number.toString()
24
+    return number.length < 2 ? pad('0' + number, 2) : number
25
+  }
26
+
27
+  return (
28
+    <li
29
+      className='sidebar__navigation__workspace__item nav-item dropdown'
30
+      onClick={handleClickTitle}
31
+    >
32
+      <div className='sidebar__navigation__workspace__item__number'>
33
+        {pad(props.number)}
34
+      </div>
35
+
36
+      <div className='sidebar__navigation__workspace__item__name' title={props.name}>
37
+        {props.name}
38
+      </div>
39
+
40
+      <div className='sidebar__navigation__workspace__item__icon'>
41
+        <i className='fa fa-chevron-down' />
42
+      </div>
43
+
44
+      <ul
45
+        className='sidebar__navigation__workspace__item__submenu'
46
+        id={`sidebarSubMenu_${props.number}`}
47
+      >
48
+        <li className='sidebar__navigation__workspace__item__submenu__dropdown'>
49
+          <div
50
+            className='sidebar__navigation__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
51
+            role='button'
52
+            data-toggle='dropdown'
53
+            aria-haspopup='true'
54
+            aria-expanded='false'
55
+          >
56
+            <div className='dropdown__icon'>
57
+              <i className='fa fa-th' />
58
+            </div>
59
+
60
+            <div className='dropdown__title' id='navbarDropdown'>
61
+              <div className='dropdown__title__text'>
62
+                Tous les fichiers
63
+              </div>
64
+            </div>
65
+          </div>
66
+
67
+          {/*
68
+          <div className='dropdown__subdropdown dropdown-menu' aria-labelledby='navbarDropdown'>
69
+            <div className='dropdown__subdropdown__item dropdown-item'>
70
+              <div className='dropdown__subdropdown__item__iconfile alignname'>
71
+                <i className='fa fa-file-text-o' />
72
+              </div>
73
+
74
+              <div className='dropdown__subdropdown__item__textfile alignname'>
75
+                Documents Archivés
76
+              </div>
77
+            </div>
78
+            <div className='dropdown__subdropdown__item dropdown-item'>
79
+              <div className='dropdown__subdropdown__item__iconfile alignname'>
80
+                <i className='fa fa-file-text-o' />
81
+              </div>
82
+
83
+              <div className='dropdown__subdropdown__item__textfile alignname'>
84
+                Documents Supprimés
85
+              </div>
86
+            </div>
87
+          </div>
88
+          */}
89
+
90
+        </li>
91
+
92
+        <li className='sidebar__navigation__workspace__item__submenu__dropdown'>
93
+          <div
94
+            className='sidebar__navigation__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
95
+            role='button'
96
+            data-toggle='dropdown'
97
+            aria-haspopup='true'
98
+            aria-expanded='false'
99
+          >
100
+            <div className='dropdown__icon'>
101
+              <i className='fa fa-signal dashboard-color' />
102
+            </div>
103
+
104
+            <div className='dropdown__title' id='navbarDropdown'>
105
+              <div className='dropdown__title__text'>
106
+                Tableau de bord
107
+              </div>
108
+            </div>
109
+          </div>
110
+        </li>
111
+
112
+        <li className='sidebar__navigation__workspace__item__submenu__dropdown'>
113
+          <div
114
+            className='sidebar__navigation__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
115
+            role='button'
116
+            data-toggle='dropdown'
117
+            aria-haspopup='true'
118
+            aria-expanded='false'
119
+          >
120
+            <div className='dropdown__icon'>
121
+              <i className='fa fa-list-ul task-color' />
122
+            </div>
123
+
124
+            <div className='dropdown__title' id='navbarDropdown'>
125
+              <div className='dropdown__title__text'>
126
+                Liste de tâches
127
+              </div>
128
+            </div>
129
+          </div>
130
+        </li>
131
+
132
+        <li className='sidebar__navigation__workspace__item__submenu__dropdown'>
133
+          <div
134
+            className='sidebar__navigation__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
135
+            role='button'
136
+            data-toggle='dropdown'
137
+            aria-haspopup='true'
138
+            aria-expanded='false'
139
+          >
140
+            <div className='dropdown__icon'>
141
+              <i className='fa fa-folder-o docandfile-color' />
142
+            </div>
143
+
144
+            <div className='dropdown__title' id='navbarDropdown'>
145
+              <div className='dropdown__title__text'>
146
+                Documents & fichiers
147
+              </div>
148
+            </div>
149
+          </div>
150
+        </li>
151
+
152
+        <li className='sidebar__navigation__workspace__item__submenu__dropdown'>
153
+          <div
154
+            className='sidebar__navigation__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
155
+            role='button'
156
+            data-toggle='dropdown'
157
+            aria-haspopup='true'
158
+            aria-expanded='false'
159
+          >
160
+            <div className='dropdown__icon'>
161
+              <i className='fa fa-comments talk-color' />
162
+            </div>
163
+
164
+            <div className='dropdown__title' id='navbarDropdown'>
165
+              <div className='dropdown__title__text'>
166
+                Discussions
167
+              </div>
168
+            </div>
169
+          </div>
170
+        </li>
171
+
172
+        <li className='sidebar__navigation__workspace__item__submenu__dropdown'>
173
+          <div
174
+            className='sidebar__navigation__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
175
+            role='button'
176
+            data-toggle='dropdown'
177
+            aria-haspopup='true'
178
+            aria-expanded='false'
179
+          >
180
+            <div className='dropdown__icon'>
181
+              <i className='fa fa-calendar calendar-color' />
182
+            </div>
183
+
184
+            <div className='dropdown__title' id='navbarDropdown'>
185
+              <div className='dropdown__title__text'>
186
+                Calendrier
187
+              </div>
188
+            </div>
189
+          </div>
190
+        </li>
191
+      </ul>
192
+    </li>
193
+  )
194
+}
195
+
196
+export default WorkspaceListItem
197
+
198
+WorkspaceListItem.propTypes = {
199
+  number: PropTypes.number.isRequired,
200
+  name: PropTypes.string.isRequired,
201
+  onClickTitle: PropTypes.func,
202
+  isOpen: PropTypes.bool
203
+}
204
+
205
+WorkspaceListItem.defaultProps = {
206
+  onClickTitle: () => {},
207
+  isOpen: false
208
+}

+ 49 - 252
src/container/Sidebar.jsx 查看文件

@@ -1,265 +1,62 @@
1 1
 import React from 'react'
2 2
 import {connect} from 'react-redux'
3
+import WorkspaceListItem from '../component/Sidebar/WorkspaceListItem.jsx'
3 4
 
4 5
 class Sidebar extends React.Component {
5
-  // constructor (props) {
6
-  //   super(props)
7
-  //   this.state = {
8
-  //     inputLogin: '',
9
-  //     inputPassword: ''
10
-  //   }
11
-  // }
6
+  constructor (props) {
7
+    super(props)
8
+    this.state = {
9
+      firstWsOpen: false
10
+    }
11
+  }
12 12
 
13
-  // <div className='sidebar-expandbar'>
14
-  //   <i className='fa fa-minus-square-o sidebar-expandbar__icon' />
15
-  // </div>
13
+  handleClickWorkspace = wsId => {
14
+    // console.log('sidebar handleClickWs')
15
+    this.setState(prev => ({firstWsOpen: !prev.firstWsOpen})) // delete this, purpose is only to test transition on click
16
+    // console.log('sidebar firstwsOpen toggled')
17
+  }
16 18
 
17 19
   render () {
20
+    // <div className='sidebar-expandbar'>
21
+    //   <i className='fa fa-minus-square-o sidebar-expandbar__icon' />
22
+    // </div>
18 23
     return (
19 24
       <div className='sidebar d-none d-lg-table-cell'>
20 25
         <nav className='sidebar__navigation navbar navbar-light'>
21
-          <div className='sidebar__navigation__menu'>
22
-            <ul className='sidebar__navigation__menu__workspace navbar-nav collapse navbar-collapse'>
23
-              <li className='sidebar__navigation__menu__workspace__item nav-item dropdown'>
24
-                <div className='sidebar__navigation__menu__workspace__item__number'>
25
-                  01
26
-                </div>
27
-
28
-                <div className='sidebar__navigation__menu__workspace__item__name'>
29
-                  Workspace 1
30
-                </div>
31
-
32
-                <div className='sidebar__navigation__menu__workspace__item__icon'>
33
-                  <i className='fa fa-chevron-down' />
34
-                </div>
35
-                <ul className='sidebar__navigation__menu__workspace__item__submenu'>
36
-                  <li className='sidebar__navigation__menu__workspace__item__submenu__dropdown'>
37
-                    <div
38
-                      className='sidebar__navigation__menu__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
39
-                      role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
40
-                      <div className='dropdown__icon'>
41
-                        <i className='fa fa-th' />
42
-                      </div>
43
-                      <div className='dropdown__title' id='navbarDropdown'>
44
-                        <div className='dropdown__title__text'>
45
-                          Tous les fichiers
46
-                        </div>
47
-                      </div>
48
-                    </div>
49
-                    <div className='dropdown__subdropdown dropdown-menu' aria-labelledby='navbarDropdown'>
50
-                      <div className='dropdown__subdropdown__item dropdown-item'>
51
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
52
-                          <i className='fa fa-file-text-o' />
53
-                        </div>
54
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
55
-                          Documents Archivés
56
-                        </div>
57
-                      </div>
58
-                      <div className='dropdown__subdropdown__item dropdown-item'>
59
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
60
-                          <i className='fa fa-file-text-o' />
61
-                        </div>
62
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
63
-                          Documents Supprimés
64
-                        </div>
65
-                      </div>
66
-                    </div>
67
-                  </li>
68
-
69
-                  <li className='sidebar__navigation__menu__workspace__item__submenu__dropdown'>
70
-                    <div
71
-                      className='sidebar__navigation__menu__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
72
-                      role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
73
-                      <div className='dropdown__icon'>
74
-                        <i className='fa fa-signal dashboard-color' />
75
-                      </div>
76
-                      <div className='dropdown__title' id='navbarDropdown'>
77
-                        <div className='dropdown__title__text'>
78
-                          Tableau de bord
79
-                        </div>
80
-                      </div>
81
-                    </div>
82
-                    <div className='dropdown__subdropdown dropdown-menu' aria-labelledby='navbarDropdown'>
83
-                      <div className='dropdown__subdropdown__item dropdown-item'>
84
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
85
-                          <i className='fa fa-file-text-o' />
86
-                        </div>
87
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
88
-                          Documents Archivés
89
-                        </div>
90
-                      </div>
91
-                      <div className='dropdown__subdropdown__item dropdown-item'>
92
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
93
-                          <i className='fa fa-file-text-o' />
94
-                        </div>
95
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
96
-                          Documents Supprimés
97
-                        </div>
98
-                      </div>
99
-                    </div>
100
-                  </li>
101
-
102
-                  <li className='sidebar__navigation__menu__workspace__item__submenu__dropdown'>
103
-                    <div
104
-                      className='sidebar__navigation__menu__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
105
-                      role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
106
-                      <div className='dropdown__icon'>
107
-                        <i className='fa fa-list-ul task-color' />
108
-                      </div>
109
-                      <div className='dropdown__title'>
110
-                        <div className='dropdown__title__text'>
111
-                          Liste des tâches
112
-                        </div>
113
-                      </div>
114
-                    </div>
115
-                    <div className='dropdown__subdropdown dropdown-menu' aria-labelledby='navbarDropdown'>
116
-                      <div className='dropdown__subdropdown__item dropdown-item'>
117
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
118
-                          <i className='fa fa-file-text-o' />
119
-                        </div>
120
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
121
-                          Documents Archivés
122
-                        </div>
123
-                      </div>
124
-                      <div className='dropdown__subdropdown__item dropdown-item'>
125
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
126
-                          <i className='fa fa-file-text-o' />
127
-                        </div>
128
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
129
-                          Documents Supprimés
130
-                        </div>
131
-                      </div>
132
-                    </div>
133
-                  </li>
134
-
135
-                  <li className='sidebar__navigation__menu__workspace__item__submenu__dropdown'>
136
-                    <div
137
-                      className='sidebar__navigation__menu__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
138
-                      role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
139
-                      <div className='dropdown__icon'>
140
-                        <i className='fa fa-folder-o docandfile-color' />
141
-                      </div>
142
-                      <div className='dropdown__title'>
143
-                        <div className='dropdown__title__text'>
144
-                          Documents & fichiers
145
-                        </div>
146
-                      </div>
147
-                    </div>
148
-                    <div className='dropdown__subdropdown dropdown-menu' aria-labelledby='navbarDropdown'>
149
-                      <div className='dropdown__subdropdown__item dropdown-item'>
150
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
151
-                          <i className='fa fa-file-text-o' />
152
-                        </div>
153
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
154
-                          Documents Archivés
155
-                        </div>
156
-                      </div>
157
-                      <div className='dropdown__subdropdown__item dropdown-item'>
158
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
159
-                          <i className='fa fa-file-text-o' />
160
-                        </div>
161
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
162
-                          Documents Supprimés
163
-                        </div>
164
-                      </div>
165
-                    </div>
166
-                  </li>
167
-
168
-                  <li className='sidebar__navigation__menu__workspace__item__submenu__dropdown'>
169
-                    <div
170
-                      className='sidebar__navigation__menu__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
171
-                      role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
172
-                      <div className='dropdown__icon'>
173
-                        <i className='fa fa-comments talk-color' />
174
-                      </div>
175
-                      <div className='dropdown__title'>
176
-                        <div className='dropdown__title__text'>
177
-                          Discussions
178
-                        </div>
179
-                      </div>
180
-                    </div>
181
-                    <div className='dropdown__subdropdown dropdown-menu' aria-labelledby='navbarDropdown'>
182
-                      <div className='dropdown__subdropdown__item dropdown-item'>
183
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
184
-                          <i className='fa fa-file-text-o' />
185
-                        </div>
186
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
187
-                          Documents Archivés
188
-                        </div>
189
-                      </div>
190
-                      <div className='dropdown__subdropdown__item dropdown-item'>
191
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
192
-                          <i className='fa fa-file-text-o' />
193
-                        </div>
194
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
195
-                          Documents Supprimés
196
-                        </div>
197
-                      </div>
198
-                    </div>
199
-                  </li>
200
-
201
-                  <li className='sidebar__navigation__menu__workspace__item__submenu__dropdown'>
202
-                    <div
203
-                      className='sidebar__navigation__menu__workspace__item__submenu__dropdown__showdropdown dropdown-toggle'
204
-                      role='button' data-toggle='dropdown' aria-haspopup='true' aria-expanded='false'>
205
-                      <div className='dropdown__icon'>
206
-                        <i className='fa fa-calendar calendar-color' />
207
-                      </div>
208
-                      <div className='dropdown__title'>
209
-                        <div className='dropdown__title__text'>
210
-                          Calendrier
211
-                        </div>
212
-                      </div>
213
-                    </div>
214
-                    <div className='dropdown__subdropdown dropdown-menu' aria-labelledby='navbarDropdown'>
215
-                      <div className='dropdown__subdropdown__item dropdown-item'>
216
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
217
-                          <i className='fa fa-file-text-o' />
218
-                        </div>
219
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
220
-                          Documents Archivés
221
-                        </div>
222
-                      </div>
223
-                      <div className='dropdown__subdropdown__item dropdown-item'>
224
-                        <div className='dropdown__subdropdown__item__iconfile alignname'>
225
-                          <i className='fa fa-file-text-o' />
226
-                        </div>
227
-                        <div className='dropdown__subdropdown__item__textfile alignname'>
228
-                          Documents Supprimés
229
-                        </div>
230
-                      </div>
231
-                    </div>
232
-                  </li>
233
-                </ul>
234
-              </li>
235
-
236
-              <li className='sidebar__navigation__menu__workspace__item nav-item dropdown'>
237
-                <div className='sidebar__navigation__menu__workspace__item__number'>
238
-                  02
239
-                </div>
240
-                <div className='sidebar__navigation__menu__workspace__item__name'>
241
-                  Workspace 2
242
-                </div>
243
-
244
-                <div className='sidebar__navigation__menu__workspace__item__icon'>
245
-                  <i className='fa fa-chevron-down' />
246
-                </div>
247
-              </li>
248
-
249
-              <li className='sidebar__navigation__menu__workspace__item nav-item dropdown'>
250
-                <div className='sidebar__navigation__menu__workspace__item__number'>
251
-                  03
252
-                </div>
253
-                <div className='sidebar__navigation__menu__workspace__item__name'>
254
-                  Workspace 3
255
-                </div>
256
-
257
-                <div className='sidebar__navigation__menu__workspace__item__icon'>
258
-                  <i className='fa fa-chevron-down' />
259
-                </div>
260
-              </li>
261
-            </ul>
262
-          </div>
26
+          <ul className='sidebar__navigation__workspace navbar-nav collapse navbar-collapse'>
27
+            <WorkspaceListItem
28
+              number={1}
29
+              name='workspace 1 sympa'
30
+              isOpen={this.state.firstWsOpen}
31
+              onClickTitle={() => this.handleClickWorkspace(1)}
32
+            />
33
+
34
+            <li className='sidebar__navigation__workspace__item nav-item dropdown'>
35
+              <div className='sidebar__navigation__workspace__item__number'>
36
+                02
37
+              </div>
38
+              <div className='sidebar__navigation__workspace__item__name'>
39
+                Workspace 2
40
+              </div>
41
+
42
+              <div className='sidebar__navigation__workspace__item__icon'>
43
+                <i className='fa fa-chevron-down' />
44
+              </div>
45
+            </li>
46
+
47
+            <li className='sidebar__navigation__workspace__item nav-item dropdown'>
48
+              <div className='sidebar__navigation__workspace__item__number'>
49
+                03
50
+              </div>
51
+              <div className='sidebar__navigation__workspace__item__name'>
52
+                Workspace 3
53
+              </div>
54
+
55
+              <div className='sidebar__navigation__workspace__item__icon'>
56
+                <i className='fa fa-chevron-down' />
57
+              </div>
58
+            </li>
59
+          </ul>
263 60
         </nav>
264 61
 
265 62
         <div className='sidebar__btnnewworkspace'>

src/container/Chat.jsx → src/container/Thread.jsx 查看文件

@@ -2,45 +2,51 @@ import React, { Component } from 'react'
2 2
 import classnames from 'classnames'
3 3
 import imgProfil from '../img/imgProfil.png'
4 4
 
5
-class Chat extends Component {
5
+class Thread extends Component {
6 6
   render () {
7 7
     return (
8
-      <div className={classnames('wsFileChat wsFileGeneric', {'visible': this.props.visible})}>
9
-        <div className='wsFileChat__header wsFileGeneric__header'>
8
+      <div className={classnames('wsFileThread wsFileGeneric', {'visible': this.props.visible})}>
9
+        <div className='wsFileThread__header wsFileGeneric__header'>
10 10
           <div className='wsFileGeneric__header__icon'>
11 11
             <i className='fa fa-comments' />
12 12
           </div>
13
+
13 14
           <div className='wsFileGeneric__header__text mr-auto'>
14 15
             Discussions à propos du nouveau système de facturation
15 16
           </div>
17
+
16 18
           <div className='wsFileGeneric__header__close'>
17 19
             <i className='fa fa-times' />
18 20
           </div>
19 21
         </div>
22
+
20 23
         <div className='wsFileGeneric__option'>
21 24
           <div className='wsFileGeneric__option__menu'>
22 25
             <div className='wsFileGeneric__option__menu__action'>
23 26
               <i className='fa fa-pencil' />
24 27
             </div>
28
+
25 29
             <div className='wsFileGeneric__option__menu__action'>
26 30
               <i className='fa fa-archive' />
27 31
             </div>
32
+
28 33
             <div className='wsFileGeneric__option__menu__action'>
29 34
               <i className='fa fa-trash' />
30 35
             </div>
31 36
           </div>
32 37
         </div>
33
-        <div className='wsFileChat__wrapper wsFileGeneric__wrapper'>
34
-          <ul className='wsFileChat__messagelist wsFileGeneric__messagelist'>
35 38
 
36
-            <li className='wsFileChat__messagelist__item wsFileGeneric__messagelist__item sended'>
39
+        <div className='wsFileThread__wrapper wsFileGeneric__wrapper'>
40
+          <ul className='wsFileThread__messagelist wsFileGeneric__messagelist'>
41
+
42
+            <li className='wsFileThread__messagelist__item wsFileGeneric__messagelist__item sended'>
37 43
               <div className='wsFileGeneric__messagelist__item__avatar'>
38 44
                 <img src={imgProfil} alt='avatar' />
39 45
               </div>
40 46
               <div className='wsFileGeneric__messagelist__item__createhour'>
41 47
                 27/11/17 à 11h45
42 48
               </div>
43
-              <div className='wsFileChat__messagelist__item__content wsFileGeneric__messagelist__item__content'>
49
+              <div className='wsFileThread__messagelist__item__content wsFileGeneric__messagelist__item__content'>
44 50
                 Proident esse laboris in sed officia exercitation ut anim ea.
45 51
               </div>
46 52
             </li>
@@ -52,7 +58,7 @@ class Chat extends Component {
52 58
               <div className='wsFileGeneric__messagelist__item__createhour'>
53 59
                 27/11/17 à 11h47
54 60
               </div>
55
-              <div className='wsFileChat__messagelist__item__content wsFileGeneric__messagelist__item__content'>
61
+              <div className='wsFileThread__messagelist__item__content wsFileGeneric__messagelist__item__content'>
56 62
                 Proident esse laboris in sed officia exercitation ut anim ea.
57 63
                 Proident esse laboris in sed officia exercitation ut anim ea.
58 64
                 Proident esse laboris in sed officia exercitation ut anim ea.
@@ -68,7 +74,7 @@ class Chat extends Component {
68 74
               <div className='wsFileGeneric__messagelist__item__createhour'>
69 75
                 27/11/17 à 11h45
70 76
               </div>
71
-              <div className='wsFileChat__messagelist__item__content wsFileGeneric__messagelist__item__content'>
77
+              <div className='wsFileThread__messagelist__item__content wsFileGeneric__messagelist__item__content'>
72 78
                 Proident esse laboris in sed officia exercitation ut anim ea.
73 79
               </div>
74 80
             </li>
@@ -80,7 +86,7 @@ class Chat extends Component {
80 86
               <div className='wsFileGeneric__messagelist__item__createhour'>
81 87
                 27/11/17 à 11h45
82 88
               </div>
83
-              <div className='wsFileChat__messagelist__item__content wsFileGeneric__messagelist__item__content'>
89
+              <div className='wsFileThread__messagelist__item__content wsFileGeneric__messagelist__item__content'>
84 90
                 Proident esse laboris in sed officia exercitation ut anim ea.
85 91
               </div>
86 92
             </li>
@@ -92,7 +98,7 @@ class Chat extends Component {
92 98
               <div className='wsFileGeneric__messagelist__item__createhour'>
93 99
                 27/11/17 à 11h47
94 100
               </div>
95
-              <div className='wsFileChat__messagelist__item__content wsFileGeneric__messagelist__item__content'>
101
+              <div className='wsFileThread__messagelist__item__content wsFileGeneric__messagelist__item__content'>
96 102
                 Proident esse laboris in sed officia exercitation ut anim ea.
97 103
                 Proident esse laboris in sed officia exercitation ut anim ea.
98 104
                 Proident esse laboris in sed officia exercitation ut anim ea.
@@ -108,7 +114,7 @@ class Chat extends Component {
108 114
               <div className='wsFileGeneric__messagelist__item__createhour'>
109 115
                 27/11/17 à 11h47
110 116
               </div>
111
-              <div className='wsFileChat__messagelist__item__content wsFileGeneric__messagelist__item__content'>
117
+              <div className='wsFileThread__messagelist__item__content wsFileGeneric__messagelist__item__content'>
112 118
                 Proident esse laboris in sed officia exercitation ut anim ea.
113 119
                 Proident esse laboris in sed officia exercitation ut anim ea.
114 120
                 Proident esse laboris in sed officia exercitation ut anim ea.
@@ -124,7 +130,7 @@ class Chat extends Component {
124 130
               <div className='wsFileGeneric__messagelist__item__createhour'>
125 131
                 27/11/17 à 11h45
126 132
               </div>
127
-              <div className='wsFileChat__messagelist__item__content wsFileGeneric__messagelist__item__content'>
133
+              <div className='wsFileThread__messagelist__item__content wsFileGeneric__messagelist__item__content'>
128 134
                 Proident esse laboris in sed officia exercitation ut anim ea.
129 135
               </div>
130 136
             </li>
@@ -136,7 +142,7 @@ class Chat extends Component {
136 142
               <div className='wsFileGeneric__messagelist__item__createhour'>
137 143
                 27/11/17 à 11h47
138 144
               </div>
139
-              <div className='wsFileChat__messagelist__item__content wsFileGeneric__messagelist__item__content'>
145
+              <div className='wsFileThread__messagelist__item__content wsFileGeneric__messagelist__item__content'>
140 146
                 Proident esse laboris in sed officia exercitation ut anim ea.
141 147
                 Proident esse laboris in sed officia exercitation ut anim ea.
142 148
                 Proident esse laboris in sed officia exercitation ut anim ea.
@@ -152,25 +158,29 @@ class Chat extends Component {
152 158
               <div className='wsFileGeneric__messagelist__item__createhour'>
153 159
                 27/11/17 à 11h45
154 160
               </div>
155
-              <div className='wsFileChat__messagelist__item__content wsFileGeneric__messagelist__item__content'>
161
+              <div className='wsFileThread__messagelist__item__content wsFileGeneric__messagelist__item__content'>
156 162
                 Proident esse laboris in sed officia exercitation ut anim ea.
157 163
               </div>
158 164
             </li>
159
-
160 165
           </ul>
161
-          <form className='wsFileChat__texteditor wsFileGeneric__texteditor'>
162
-            <div className='wsFileChat__texteditor__simpletext wsFileGeneric__texteditor__simpletext input-group'>
163
-              <input type='text' className='wsFileChat__texteditor__simpletext__input wsFileGeneric__texteditor__simpletext__input form-control' placeholder='...' />
164
-              <div className='wsFileChat__texteditor__simpletext__icon wsFileGeneric__texteditor__simpletext__icon input-group-addon'>
166
+
167
+          <form className='wsFileThread__texteditor wsFileGeneric__texteditor'>
168
+            <div className='wsFileThread__texteditor__simpletext wsFileGeneric__texteditor__simpletext input-group'>
169
+              <input type='text' className='wsFileThread__texteditor__simpletext__input wsFileGeneric__texteditor__simpletext__input form-control' placeholder='...' />
170
+
171
+              <div className='wsFileThread__texteditor__simpletext__icon wsFileGeneric__texteditor__simpletext__icon input-group-addon'>
165 172
                 <i className='fa fa-font' />
166 173
               </div>
167 174
             </div>
175
+
168 176
             <div className='wsFileGeneric__texteditor__wysiwyg d-none d-xl-block'>
169 177
               <textarea />
170 178
             </div>
171
-            <div className='wsFileChat__texteditor__submit wsFileGeneric__texteditor__submit d-xl-flex justify-content-xl-center'>
172
-              <button type='submit' className='wsFileChat__texteditor__submit__btn wsFileGeneric__texteditor__submit__btn btn btn-primary'>Envoyer
173
-                <div className='wsFileChat__texteditor__submit__btn__icon wsFileGeneric__texteditor__submit__btn__icon'>
179
+
180
+            <div className='wsFileThread__texteditor__submit wsFileGeneric__texteditor__submit d-xl-flex justify-content-xl-center'>
181
+              <button type='submit' className='wsFileThread__texteditor__submit__btn wsFileGeneric__texteditor__submit__btn btn btn-primary'>
182
+                Envoyer
183
+                <div className='wsFileThread__texteditor__submit__btn__icon wsFileGeneric__texteditor__submit__btn__icon'>
174 184
                   <i className='fa fa-paper-plane-o' />
175 185
                 </div>
176 186
               </button>
@@ -182,4 +192,4 @@ class Chat extends Component {
182 192
   }
183 193
 }
184 194
 
185
-export default Chat
195
+export default Thread

+ 8 - 8
src/container/Workspace.jsx 查看文件

@@ -3,7 +3,7 @@ import { connect } from 'react-redux'
3 3
 import Folder from '../component/Workspace/Folder.jsx'
4 4
 import FileItem from '../component/Workspace/FileItem.jsx'
5 5
 import FileItemHeader from '../component/Workspace/FileItemHeader.jsx'
6
-// import Chat from './Chat.jsx'
6
+import Thread from './Thread.jsx'
7 7
 // import PageText from './PageText.jsx'
8 8
 import PageWrapper from '../component/common/layout/PageWrapper.jsx'
9 9
 import PageTitle from '../component/common/layout/PageTitle.jsx'
@@ -56,28 +56,28 @@ class Workspace extends React.Component {
56 56
             <Folder>
57 57
               <FileItem type='file' name='Facture 57839 - Société ABC - 01/09/2017' status='current' />
58 58
               <FileItem type='file' name='Facture 57839 - Société ABC - 01/09/2017' status='current' />
59
-              <FileItem type='task' name='Editer la facture pour Phillipe GIRARD' status='check' />
59
+              <FileItem type='task' name='Editer la facture pour Phillipe GIRARD' status='validated' />
60 60
 
61 61
               <Folder>
62
-                <FileItem type='chat' name='Discussions à propos du nouveau système de facturation' status='nouse' />
63
-                <FileItem type='file' name='Facture 57537 - Claudia Martin - 14/08/2017' status='check' />
62
+                <FileItem type='chat' name='Discussions à propos du nouveau système de facturation' status='canceled' />
63
+                <FileItem type='file' name='Facture 57537 - Claudia Martin - 14/08/2017' status='validated' />
64 64
               </Folder>
65 65
 
66 66
               <FileItem name='Facture 57841 - Pierre Maurice - 06/06/2017' type='file' status='current' />
67
-              <FileItem type='file' name='Facture 57840 - Jean-michel Chevalier - 04/09/2017' status='check' />
67
+              <FileItem type='file' name='Facture 57840 - Jean-michel Chevalier - 04/09/2017' status='validated' />
68 68
               <FileItem name='Facture 57841 - Pierre Maurice - 06/06/2017' type='file' status='current' />
69 69
 
70 70
               <Folder>
71
-                <FileItem type='chat' name='Discussions à propos du nouveau système de facturation' status='nouse' />
72
-                <FileItem type='file' name='Facture 57537 - Claudia Martin - 14/08/2017' status='check' />
71
+                <FileItem type='chat' name='Discussions à propos du nouveau système de facturation' status='canceled' />
72
+                <FileItem type='file' name='Facture 57537 - Claudia Martin - 14/08/2017' status='validated' />
73 73
               </Folder>
74 74
             </Folder>
75 75
           </div>
76 76
 
77 77
           <DropdownCreateButton customClass='workspace__content__button mb-5' />
78 78
 
79
+          <Thread visible={this.state.activeFileType === 'chat'} />
79 80
           {/*
80
-          <Chat visible={this.state.activeFileType === 'chat'} />
81 81
           <PageText visible={this.state.activeFileType === 'file'} />
82 82
           */}
83 83
         </PageContent>

+ 116 - 0
src/css/Generic.styl 查看文件

@@ -70,3 +70,119 @@
70 70
     cursor pointer
71 71
     .setting__link
72 72
       padding 5px 65px 5px 10px
73
+
74
+
75
+.wsFileGeneric
76
+  position fixed
77
+  top 85px
78
+  right 0
79
+  border 1px solid grey
80
+  height 100%
81
+  background-color light-grey
82
+  box-shadow shadow-page
83
+  visibility hidden
84
+  &.visible
85
+    visibility visible
86
+  &__header
87
+    display flex
88
+    align-items center
89
+    padding 15px
90
+    height 64px
91
+    &__icon
92
+      margin-right 15px
93
+      font-size 22px
94
+      color white
95
+    &__title
96
+      margin-right 15px
97
+      color white
98
+      text-overflow ellipsis
99
+      overflow hidden
100
+      white-space nowrap
101
+    &__close
102
+      border 1px solid white
103
+      border-radius 5px
104
+      padding 2px 5px
105
+      cursor pointer
106
+      & > i
107
+        color white
108
+        font-size 20px
109
+  &__option
110
+    border-bottom 1px solid grey
111
+    padding 15px
112
+    height 58px
113
+    background-color off-white
114
+    & > i
115
+      vertical-align middle
116
+      margin-right 15px
117
+      font-size 25px
118
+      cursor pointer
119
+    &__menu
120
+      display inline-block
121
+      vertical-align middle
122
+      &__action
123
+        display inline-block
124
+        margin-right 10px
125
+        font-size 18px
126
+        cursor pointer
127
+  &__wrapper
128
+    display flex
129
+    flex-direction column
130
+  &__messagelist
131
+    margin-bottom 0
132
+    flex-grow 1
133
+    border-bottom 1px solid grey
134
+    overflow-Y auto
135
+    list-style none
136
+    &__item
137
+      &__avatar
138
+        position relative
139
+        top 43px
140
+        left -25px
141
+        width 45px
142
+        height 45px
143
+      &__createhour
144
+        margin-left 30px
145
+        opacity 0.7
146
+        font-size 14px
147
+      &__content
148
+        border 1px solid grey
149
+        border-radius 5px
150
+        padding 15px
151
+        background-color off-white
152
+        font-size 15px
153
+        z-index -1
154
+  &__texteditor
155
+    padding 2px
156
+    &__simpletext
157
+      display none
158
+      width 70%
159
+      margin-right 35px
160
+      &__icon
161
+        cursor pointer
162
+    &__wysiwyg
163
+      display block
164
+      & > textarea
165
+        width 100%
166
+        height 130px
167
+    &__submit
168
+      margin 10px 0
169
+      &__btn
170
+        display flex
171
+        background-color transparent
172
+        &__icon
173
+          margin-left 10px
174
+
175
+.sended
176
+  .wsFileGeneric__messagelist__item__content
177
+    margin-right 25%
178
+
179
+.received
180
+  .wsFileGeneric__messagelist__item
181
+    &__avatar
182
+      left 93%
183
+    &__createhour
184
+      text-align right
185
+      margin-right 50px
186
+    &__content
187
+      margin-left 25%
188
+      color white

+ 71 - 69
src/css/Sidebar.styl 查看文件

@@ -43,76 +43,78 @@ sidebar-width = 300px
43 43
       padding 15px 30px
44 44
   &__navigation
45 45
     padding 0
46
-    &__menu
47
-      &__workspace
48
-        flex-direction column
49
-        &__item
50
-          position relative
51
-          margin-top 2px
52
-          width sidebar-width
53
-          background-color blue
54
-          cursor pointer
55
-          &__number
56
-            display inline-block
57
-            padding 5px 0 5px 0
58
-            width 50px
59
-            font-size 20px
60
-            letter-spacing 2px
61
-            text-align center
62
-            background-color light-blue
63
-          &__name
64
-            display inline-block
65
-            vertical-align top
66
-            padding 5px 5px
67
-            width 220px
68
-            font-size 20px
69
-            color white
70
-            white-space nowrap
71
-            overflow hidden
72
-            text-overflow ellipsis
73
-          &__icon
74
-            display inline-block
75
-            color white
76
-          &__submenu
77
-            margin-bottom 0
78
-            padding-left 0
79
-            list-style none
80
-            background-color opacity-blue
81
-            &__dropdown
82
-              border-top 1px solid dark-blue
83
-              &:hover
84
-                background-color light-blue
85
-              &__showdropdown
86
-                padding 10px 0
87
-              .dropdown__icon
46
+    &__workspace
47
+      flex-direction column
48
+      &__item
49
+        position relative
50
+        margin-top 2px
51
+        width sidebar-width
52
+        background-color blue
53
+        cursor pointer
54
+        &__number
55
+          display inline-block
56
+          padding 5px 0 5px 0
57
+          width 50px
58
+          font-size 20px
59
+          letter-spacing 2px
60
+          text-align center
61
+          background-color light-blue
62
+        &__name
63
+          display inline-block
64
+          vertical-align top
65
+          padding 5px 5px
66
+          width 220px
67
+          font-size 20px
68
+          color white
69
+          white-space nowrap
70
+          overflow hidden
71
+          text-overflow ellipsis
72
+        &__icon
73
+          display inline-block
74
+          color white
75
+        &__submenu
76
+          margin-bottom 0
77
+          padding-left 0
78
+          height 0 // height is handled is js
79
+          list-style none
80
+          background-color opacity-blue
81
+          overflow hidden
82
+          transition height 0.5s
83
+          &__dropdown
84
+            border-top 1px solid dark-blue
85
+            &:hover
86
+              background-color light-blue
87
+            &__showdropdown
88
+              padding 10px 0
89
+            .dropdown__icon
90
+              display inline-block
91
+              margin 0 35px 0 15px
92
+              font-size 20px
93
+            .dropdown__title
94
+              position relative
95
+              display inline-block
96
+              font-size 18px
97
+              font-weight 400
98
+              color dark-grey
99
+              cursor pointer
100
+              &::after //bootstrap override
101
+                position absolute
102
+                top 10px
103
+                left 100%
104
+              &__text
88 105
                 display inline-block
89
-                margin 0 35px 0 15px
90
-                font-size 20px
91
-              .dropdown__title
92
-                position relative
106
+                width 200px
107
+            .dropdown__subdropdown
108
+              border-radius 0
109
+              padding 0
110
+              .alignname
93 111
                 display inline-block
94 112
                 font-size 18px
95
-                font-weight 400
96
-                color dark-grey
113
+              &__item
97 114
                 cursor pointer
98
-                &::after //bootstrap override
99
-                  position absolute
100
-                  top 10px
101
-                  left 100%
102
-                &__text
103
-                  display inline-block
104
-                  width 200px
105
-              .dropdown__subdropdown
106
-                border-radius 0
107
-                padding 0
108
-                .alignname
109
-                  display inline-block
110
-                  font-size 18px
111
-                &__item
112
-                  cursor pointer
113
-                  border-top 1px solid dark-blue
114
-                  padding 13px 0
115
-                  &__iconfile
116
-                    padding-left 18px
117
-                  &__textfile
118
-                    margin-left 38px
115
+                border-top 1px solid dark-blue
116
+                padding 13px 0
117
+                &__iconfile
118
+                  padding-left 18px
119
+                &__textfile
120
+                  margin-left 38px

+ 55 - 0
src/css/Thread.styl 查看文件

@@ -0,0 +1,55 @@
1
+.wsFileThread
2
+  width 550px
3
+  &__header
4
+    color white
5
+    background-color blue
6
+  &__wrapper
7
+    height calc(100% - 209px) /* height of chat__header + height of option + top of chat */
8
+  &__messagelist
9
+    padding 15px 35px
10
+    &__item
11
+      &__content
12
+        color dark-blue
13
+  &__texteditor
14
+    &__simpletext
15
+      &__input
16
+        &:focus
17
+          color dark-blue
18
+          border-color dark-blue
19
+    &__submit
20
+      &__btn
21
+        color dark-blue
22
+
23
+.received
24
+  .wsFileThread__messagelist__item__content
25
+      background-color dark-blue
26
+
27
+@media (min-width: max-xs) and (max-width: max-lg)
28
+  .wsFileThread
29
+    &__texteditor
30
+      padding 7px
31
+      &__simpletext
32
+        display inline-flex
33
+      &__submit
34
+        display inline-flex
35
+        width 80px
36
+
37
+@media (min-width: min-sm) and (max-width: max-sm)
38
+  .wsFileThread
39
+    top 69px
40
+
41
+@media (max-width: max-xs)
42
+  .wsFileThread
43
+    top 69px
44
+    width 100%
45
+    box-shadow none
46
+    z-index 1
47
+    &__texteditor
48
+      padding 7px
49
+      &__simpletext
50
+        display inline-flex
51
+        margin-right 15px
52
+        width 62%
53
+      &__submit
54
+        display inline-flex
55
+        width 80px

+ 2 - 0
src/css/index.styl 查看文件

@@ -16,3 +16,5 @@ html, body, #content, #content > div
16 16
 @import 'FileItem'
17 17
 @import 'FileItemHeader'
18 18
 @import 'Folder'
19
+
20
+@import 'Thread'