Browse Source

about to refactor wrokspace .fileitem__rowfile border bottom

Skylsmoi 7 years ago
parent
commit
eb0649309f

+ 1 - 1
src/component/Login/LoginBtnForgotPw.jsx View File

12
 
12
 
13
 export default LoginBtnForgotPw
13
 export default LoginBtnForgotPw
14
 
14
 
15
-LoginBtnForgotPw.PropTypes = {
15
+LoginBtnForgotPw.propTypes = {
16
   customClass: PropTypes.string,
16
   customClass: PropTypes.string,
17
   label: PropTypes.string
17
   label: PropTypes.string
18
 }
18
 }

+ 1 - 1
src/component/Login/LoginLogo.jsx View File

10
 }
10
 }
11
 export default Logo
11
 export default Logo
12
 
12
 
13
-Logo.PropTypes = {
13
+Logo.propTypes = {
14
   logoSrc: PropTypes.string.isRequired,
14
   logoSrc: PropTypes.string.isRequired,
15
   customClass: PropTypes.string
15
   customClass: PropTypes.string
16
 }
16
 }

+ 78 - 0
src/component/Workspace/FileItem.jsx View File

1
+import React from 'react'
2
+import PropTypes from 'prop-types'
3
+import classnames from 'classnames'
4
+
5
+const FileItem = props => {
6
+  const iconType = (() => {
7
+    switch (props.type) {
8
+      case 'file':
9
+        return 'fa fa-file-text-o docandfile-color'
10
+      case 'chat':
11
+        return 'fa fa-comments talk-color'
12
+      case 'task':
13
+        return 'fa fa-list-ul task-color'
14
+    }
15
+  })()
16
+
17
+  const iconStatus = (() => {
18
+    switch (props.status) {
19
+      case 'current':
20
+        return 'fa fa-cogs current-color'
21
+      case 'validated':
22
+        return 'fa fa-check validated-color'
23
+      case 'canceled':
24
+        return 'fa fa-ban canceled-color'
25
+      case 'outdated':
26
+        return '' // @TODO
27
+    }
28
+  })()
29
+
30
+  return (
31
+    <div className={classnames('fileitem__rowfile', 'align-items-center', props.customClass)} onClick={props.onClickItem}>
32
+      <div className='col-2 col-sm-2 col-md-2 col-lg-2 col-xl-1'>
33
+        <div className='fileitem__rowfile__type'>
34
+          <i className={iconType} />
35
+        </div>
36
+      </div>
37
+      <div className='col-8 col-sm-8 col-md-8 col-lg-8 col-xl-10'>
38
+        <div className='fileitem__rowfile__name'>
39
+          <div className='fileitem__rowfile__name__text'>
40
+            { props.name }
41
+          </div>
42
+          <div className='fileitem__rowfile__name__icons d-none d-md-flex'>
43
+            <div className='fileitem__rowfile__name__icons__download'>
44
+              <i className='fa fa-download' />
45
+            </div>
46
+            <div className='fileitem__rowfile__name__icons__archive'>
47
+              <i className='fa fa-archive' />
48
+            </div>
49
+            <div className='fileitem__rowfile__name__icons__delete'>
50
+              <i className='fa fa-trash-o' />
51
+            </div>
52
+          </div>
53
+        </div>
54
+      </div>
55
+      <div className='col-2 col-sm-2 col-md-2 col-lg-2 col-xl-1'>
56
+        <div className='fileitem__rowfile__status'>
57
+          <i className={iconStatus} />
58
+        </div>
59
+      </div>
60
+    </div>
61
+  )
62
+}
63
+
64
+export default FileItem
65
+
66
+FileItem.propTypes = {
67
+  type: PropTypes.string.isRequired,
68
+  status: PropTypes.string.isRequired,
69
+  customClass: PropTypes.string,
70
+  name: PropTypes.string,
71
+  onClickItem: PropTypes.func
72
+}
73
+
74
+FileItem.defaultProps = {
75
+  name: '',
76
+  customClass: '',
77
+  onClickItem: () => {}
78
+}

+ 25 - 0
src/component/Workspace/FileItemHeader.jsx View File

1
+import React from 'react'
2
+
3
+const FileItemHeader = props => {
4
+  return (
5
+    <div className='fileitem__header'>
6
+      <div className='col-2 col-sm-2 col-md-2 col-lg-2 col-xl-1'>
7
+        <div className='fileitem__header__type'>
8
+          Type
9
+        </div>
10
+      </div>
11
+      <div className='col-8 col-sm-8 col-md-8 col-lg-8 col-xl-10'>
12
+        <div className='fileitem__header__name'>
13
+          Nom du document ou fichier
14
+        </div>
15
+      </div>
16
+      <div className='col-2 col-sm-2 col-md-2 col-lg-2 col-xl-1'>
17
+        <div className='fileitem__header__status'>
18
+          Statut
19
+        </div>
20
+      </div>
21
+    </div>
22
+  )
23
+}
24
+
25
+export default FileItemHeader

src/container/Folder.jsx → src/component/Workspace/Folder.jsx View File

1
 import React, { Component } from 'react'
1
 import React, { Component } from 'react'
2
+// import PropTypes from 'prop-types'
3
+// import classnames from 'classnames'
4
+
5
+// @TODO set Folder as a component, state open will come from parent container (which will come from redux)
2
 
6
 
3
 class Folder extends Component {
7
 class Folder extends Component {
4
   constructor (props) {
8
   constructor (props) {
10
   }
14
   }
11
 
15
 
12
   handleClickToggleFolder = () => this.setState({open: !this.state.open})
16
   handleClickToggleFolder = () => this.setState({open: !this.state.open})
17
+  handleClickNewFile = e => {
18
+    e.stopPropagation() // because we have a link inside a link (togler and newFile)
19
+    console.log('new file') // @TODO
20
+  }
13
 
21
 
14
   render () {
22
   render () {
15
     return (
23
     return (
25
             <div className='folder__header__name__text'>
33
             <div className='folder__header__name__text'>
26
               Dossier Facture
34
               Dossier Facture
27
             </div>
35
             </div>
28
-            <div className='folder__header__name__addbtn'>
36
+            <div className='folder__header__name__addbtn' onClick={this.handleClickNewFile}>
29
               <div className='folder__header__name__addbtn__text btn btn-primary'>
37
               <div className='folder__header__name__addbtn__text btn btn-primary'>
30
                 créer ...
38
                 créer ...
31
               </div>
39
               </div>

+ 0 - 55
src/container/FileItem.jsx View File

1
-import React, { Component } from 'react'
2
-
3
-class FileItem extends Component {
4
-  render () {
5
-    const { type, status, customClass } = this.props
6
-
7
-    let faClass = ''
8
-    if (type === 'file') faClass = 'fa fa-file-text-o docandfile-color'
9
-    else if (type === 'chat') faClass = 'fa fa-comments talk-color'
10
-    else if (type === 'task') faClass = 'fa fa-list-ul task-color'
11
-
12
-    let iconStatus = ''
13
-    if (status === 'current') iconStatus = 'fa fa-cogs current-color'
14
-    else if (status === 'nouse') iconStatus = 'fa fa-ban nouse-color'
15
-    else if (status === 'check') iconStatus = 'fa fa-check check-color'
16
-
17
-    let classInFolder = ''
18
-    if (customClass === 'inFolder') classInFolder = 'inFolder'
19
-
20
-    return (
21
-      <div className={'fileitem__rowfile align-items-center ' + (classInFolder)} onClick={this.props.onClickElement}>
22
-        <div className='col-2 col-sm-2 col-md-2 col-lg-2 col-xl-1'>
23
-          <div className='fileitem__rowfile__type'>
24
-            <i className={faClass} />
25
-          </div>
26
-        </div>
27
-        <div className='col-8 col-sm-8 col-md-8 col-lg-8 col-xl-10'>
28
-          <div className='fileitem__rowfile__name'>
29
-            <div className='fileitem__rowfile__name__text'>
30
-              { this.props.name }
31
-            </div>
32
-            <div className='fileitem__rowfile__name__icons d-none d-md-flex'>
33
-              <div className='fileitem__rowfile__name__icons__download'>
34
-                <i className='fa fa-download' />
35
-              </div>
36
-              <div className='fileitem__rowfile__name__icons__archive'>
37
-                <i className='fa fa-archive' />
38
-              </div>
39
-              <div className='fileitem__rowfile__name__icons__delete'>
40
-                <i className='fa fa-trash-o' />
41
-              </div>
42
-            </div>
43
-          </div>
44
-        </div>
45
-        <div className='col-2 col-sm-2 col-md-2 col-lg-2 col-xl-1'>
46
-          <div className='fileitem__rowfile__status'>
47
-            <i className={iconStatus} />
48
-          </div>
49
-        </div>
50
-      </div>
51
-    )
52
-  }
53
-}
54
-
55
-export default FileItem

+ 0 - 27
src/container/FileItemHeader.jsx View File

1
-import React, { Component } from 'react'
2
-
3
-class FileItemHeader extends Component {
4
-  render () {
5
-    return (
6
-      <div className='fileitemheader'>
7
-        <div className='col-2 col-sm-2 col-md-2 col-lg-2 col-xl-1'>
8
-          <div className='fileitemheader__type'>
9
-            Type
10
-          </div>
11
-        </div>
12
-        <div className='col-8 col-sm-8 col-md-8 col-lg-8 col-xl-10'>
13
-          <div className='fileitemheader__name'>
14
-            Nom du document ou fichier
15
-          </div>
16
-        </div>
17
-        <div className='col-2 col-sm-2 col-md-2 col-lg-2 col-xl-1'>
18
-          <div className='fileitemheader__status'>
19
-            Statut
20
-          </div>
21
-        </div>
22
-      </div>
23
-    )
24
-  }
25
-}
26
-
27
-export default FileItemHeader

+ 14 - 12
src/container/Workspace.jsx View File

1
 import React from 'react'
1
 import React from 'react'
2
 import { connect } from 'react-redux'
2
 import { connect } from 'react-redux'
3
-import classnames from 'classnames'
4
-import Folder from './Folder.jsx'
5
-import FileItem from './FileItem.jsx'
6
-import FileItemHeader from './FileItemHeader.jsx'
3
+import Folder from '../component/Workspace/Folder.jsx'
4
+import FileItem from '../component/Workspace/FileItem.jsx'
5
+import FileItemHeader from '../component/Workspace/FileItemHeader.jsx'
7
 // import Chat from './Chat.jsx'
6
 // import Chat from './Chat.jsx'
8
 // import PageText from './PageText.jsx'
7
 // import PageText from './PageText.jsx'
9
 import PageWrapper from '../component/common/layout/PageWrapper.jsx'
8
 import PageWrapper from '../component/common/layout/PageWrapper.jsx'
35
           <div className='workspace__content__fileandfolder'>
34
           <div className='workspace__content__fileandfolder'>
36
             <FileItemHeader />
35
             <FileItemHeader />
37
 
36
 
38
-            <FileItem name='Facture 57841 - Pierre Maurice - 06/06/2017' type='file' status='current' />
39
             <FileItem
37
             <FileItem
38
+              name='Facture 57841 - Pierre Maurice - 06/06/2017'
40
               type='file'
39
               type='file'
40
+              status='current'
41
+              onClickItem={() => this.setState({activeFileType: 'file'})}
42
+            />
43
+            <FileItem
41
               name='Facture 57840 - Jean-michel Chevalier - 04/09/2017'
44
               name='Facture 57840 - Jean-michel Chevalier - 04/09/2017'
42
-              status='check'
43
-              onClickElement={() => this.setState({activeFileType: 'file'})}
45
+              type='file'
46
+              status='validated'
47
+              onClickItem={() => this.setState({activeFileType: 'file'})}
44
             />
48
             />
45
             <FileItem
49
             <FileItem
46
-              type='chat'
47
               name='Discussions à propos du nouveau système de facturation'
50
               name='Discussions à propos du nouveau système de facturation'
48
-              status='nouse'
49
-              customClass='inFolder'
50
-              onClickElement={() => this.setState({activeFileType: 'chat'})}
51
+              type='chat'
52
+              status='canceled'
53
+              onClickItem={() => this.setState({activeFileType: 'chat'})}
51
             />
54
             />
52
 
55
 
53
             <Folder>
56
             <Folder>
66
                 <FileItem type='chat' name='Discussions à propos du nouveau système de facturation' status='nouse' customClass='inFolder' />
69
                 <FileItem type='chat' name='Discussions à propos du nouveau système de facturation' status='nouse' customClass='inFolder' />
67
                 <FileItem type='file' name='Facture 57537 - Claudia Martin - 14/08/2017' status='check' customClass='inFolder' />
70
                 <FileItem type='file' name='Facture 57537 - Claudia Martin - 14/08/2017' status='check' customClass='inFolder' />
68
               </Folder>
71
               </Folder>
69
-              <FileItem type='file' name='Facture 57840 - Jean-michel Chevalier - 04/09/2017' status='check' customClass='inFolder' />
70
             </Folder>
72
             </Folder>
71
           </div>
73
           </div>
72
 
74
 

+ 2 - 4
src/css/FileItemHeader.styl View File

1
-.fileitemheader
1
+.fileitem__header
2
   display flex
2
   display flex
3
+  font-size 17px
3
   &__type
4
   &__type
4
     padding 15px 0
5
     padding 15px 0
5
     text-align center
6
     text-align center
6
-    font-size 17px
7
   &__name
7
   &__name
8
     padding 15px 5px
8
     padding 15px 5px
9
     width 100%
9
     width 100%
10
-    font-size 17px
11
   &__status
10
   &__status
12
     padding 15px 0
11
     padding 15px 0
13
     width 100%
12
     width 100%
14
     text-align center
13
     text-align center
15
-    font-size 17px

+ 3 - 17
src/css/Folder.styl View File

1
-/****** FOLDER CLOSE *******/
2
-
3
 folderclose()
1
 folderclose()
4
   height 0
2
   height 0
5
   visibility hidden
3
   visibility hidden
6
   opacity 0
4
   opacity 0
7
   border 0
5
   border 0
8
 
6
 
9
-/*****************************/
10
-
11
-/****** FOLDER OPEN *******/
12
-
13
 folderopen()
7
 folderopen()
14
   height 100%
8
   height 100%
15
   opacity 1
9
   opacity 1
16
   visibility visible
10
   visibility visible
17
   transition opacity 1s
11
   transition opacity 1s
18
 
12
 
19
-/*****************************/
20
-
21
 .folder
13
 .folder
22
   padding-left 30px
14
   padding-left 30px
23
   &:last-child
15
   &:last-child
24
     border-bottom 1px solid dark-blue
16
     border-bottom 1px solid dark-blue
25
   & > .inFolder
17
   & > .inFolder
26
     folderclose()
18
     folderclose()
27
-    &:last-child
28
-      border-bottom 0
29
   & > .folder
19
   & > .folder
30
     folderclose()
20
     folderclose()
31
   &.active
21
   &.active
40
         display block
30
         display block
41
         &__triangle
31
         &__triangle
42
           display block
32
           display block
33
+
43
   &__header
34
   &__header
44
     position relative
35
     position relative
45
     display flex
36
     display flex
50
     background-color light-grey
41
     background-color light-grey
51
     cursor pointer
42
     cursor pointer
52
     &:hover
43
     &:hover
53
-      background-color hover
44
+      background-color hover-folder
54
       .folder__header__triangleborder__triangle
45
       .folder__header__triangleborder__triangle
55
-        border-color hover transparent transparent transparent
46
+        border-color hover-folder transparent transparent transparent
56
     &__triangleborder
47
     &__triangleborder
57
       display none
48
       display none
58
       position absolute
49
       position absolute
104
         & > i
95
         & > i
105
           margin-right 15px
96
           margin-right 15px
106
 
97
 
107
-/*****************************/
108
-
109
-/**** MEDIA 575px ****/
110
-
111
 @media (max-width: max-xs)
98
 @media (max-width: max-xs)
112
-
113
   .folder
99
   .folder
114
     &__header
100
     &__header
115
       &__triangleborder
101
       &__triangleborder

+ 1 - 1
src/css/Sidebar.styl View File

32
     vertical-align top
32
     vertical-align top
33
 
33
 
34
 .sidebar
34
 .sidebar
35
-  padding-top 87px
35
+  padding-top 85px
36
   &__btnnewworkspace
36
   &__btnnewworkspace
37
     margin-top 40px
37
     margin-top 40px
38
     padding 10px
38
     padding 10px

+ 3 - 3
src/css/Variable.styl View File

7
 opacity-blue = #82B2CC // #82B2CC  blue with light opacity
7
 opacity-blue = #82B2CC // #82B2CC  blue with light opacity
8
 off-white = #FDFDFD // #FDFDFD off-white
8
 off-white = #FDFDFD // #FDFDFD off-white
9
 dark-grey = #252525 // #252525 dark-grey
9
 dark-grey = #252525 // #252525 dark-grey
10
-hover = #9BC1EB // #9BC1EB hover on folder
10
+hover-folder = #9BC1EB // #9BC1EB hover on folder
11
 hover-files = rgba(155,193,235,0.2) // hover on files
11
 hover-files = rgba(155,193,235,0.2) // hover on files
12
 grey = #ABABAB // #ABABAB grey
12
 grey = #ABABAB // #ABABAB grey
13
 light-grey = #f0f0f0 // #f0f0f0 light grey
13
 light-grey = #f0f0f0 // #f0f0f0 light grey
55
   color red
55
   color red
56
 .current-color
56
 .current-color
57
   color blue
57
   color blue
58
-.nouse-color
58
+.canceled-color
59
   color dark-grey
59
   color dark-grey
60
-.check-color
60
+.validated-color
61
   color green
61
   color green

BIN
src/img/imgProfil.png View File


BIN
src/img/imgProfil_orange.png View File


BIN
src/img/imgProfil_reverse.png View File