Browse Source

Refactor Component PopinFixedOption

AlexiCauvin 6 years ago
parent
commit
e6e262e069

+ 18 - 0
src/component/OptionComponent/EditContent.jsx View File

1
+import React, { Component } from 'react'
2
+
3
+class EditContent extends Component {
4
+  render () {
5
+    return (
6
+      <div className='d-flex align-items-center'>
7
+        <div className='wsContentGeneric__option__menu__action d-none d-sm-block'>
8
+          <i className='fa fa-archive' />
9
+        </div>
10
+        <div className='wsContentGeneric__option__menu__action d-none d-sm-block'>
11
+          <i className='fa fa-trash' />
12
+        </div>
13
+      </div>
14
+    )
15
+  }
16
+}
17
+
18
+export default EditContent

+ 17 - 0
src/component/OptionComponent/NewVersionBtn.jsx View File

1
+import React, { Component } from 'react'
2
+
3
+class NewVersionBtn extends Component {
4
+  render () {
5
+    return (
6
+      <div
7
+        className='wsContentGeneric__option__menu__addversion btn btn-outline-primary mr-auto'
8
+        onClick={this.props.onClickNewVersionBtn}
9
+      >
10
+        Nouvelle version
11
+        <i className='fa fa-plus-circle ml-3' />
12
+      </div>
13
+    )
14
+  }
15
+}
16
+
17
+export default NewVersionBtn

+ 12 - 0
src/component/OptionComponent/StatusContent.jsx View File

1
+import React, { Component } from 'react'
2
+import SelectStatus from '../Input/SelectStatus/SelectStatus.jsx'
3
+
4
+class StatusContent extends Component {
5
+  render () {
6
+    return (
7
+      <SelectStatus />
8
+    )
9
+  }
10
+}
11
+
12
+export default StatusContent

+ 10 - 17
src/component/PopinFixed/PopinFixedOption.jsx View File

3
 import PropTypes from 'prop-types'
3
 import PropTypes from 'prop-types'
4
 import { translate } from 'react-i18next'
4
 import { translate } from 'react-i18next'
5
 import i18n from '../../i18n.js'
5
 import i18n from '../../i18n.js'
6
-import SelectStatus from '../Input/SelectStatus/SelectStatus.jsx'
6
+import StatusContent from '../OptionComponent/StatusContent.jsx'
7
+import NewVersionBtn from '../OptionComponent/NewVersionBtn.jsx'
8
+import EditContent from '../OptionComponent/EditContent.jsx'
7
 
9
 
8
 const PopinFixedOption = props => {
10
 const PopinFixedOption = props => {
9
   translate.setI18n(props.i18n ? props.i18n : i18n) // mandatory to allow Apps to overrides trad
11
   translate.setI18n(props.i18n ? props.i18n : i18n) // mandatory to allow Apps to overrides trad
11
   return (
13
   return (
12
     <div className={classnames('wsContentGeneric__option', `${props.customClass}__option`)}>
14
     <div className={classnames('wsContentGeneric__option', `${props.customClass}__option`)}>
13
       <div className={classnames('wsContentGeneric__option__menu', `${props.customClass}__option__menu`)}>
15
       <div className={classnames('wsContentGeneric__option__menu', `${props.customClass}__option__menu`)}>
14
-        <div
15
-          className='wsContentGeneric__option__menu__addversion btn btn-outline-primary mr-auto'
16
-          onClick={props.onClickNewVersion}
17
-        >
18
-          {props.t('PopinFixedOption.new_version')}
19
-          <i className='fa fa-plus-circle ml-3' />
20
-        </div>
21
-
22
-        <SelectStatus />
23
-
24
-        <div className={classnames('wsContentGeneric__option__menu__action d-none d-sm-block', `${props.customClass}__option__menu__action`)}>
25
-          <i className='fa fa-archive' />
26
-        </div>
27
-        <div className={classnames('wsContentGeneric__option__menu__action d-none d-sm-block', `${props.customClass}__option__menu__action`)}>
28
-          <i className='fa fa-trash' />
29
-        </div>
16
+
17
+        <NewVersionBtn onClickNewVersionBtn={props.onClickNewVersionBtn} />
18
+
19
+        <StatusContent />
20
+
21
+        <EditContent />
22
+
30
       </div>
23
       </div>
31
     </div>
24
     </div>
32
   )
25
   )