瀏覽代碼

Refactor Component PopinFixedOption

AlexiCauvin 6 年之前
父節點
當前提交
e6e262e069

+ 18 - 0
src/component/OptionComponent/EditContent.jsx 查看文件

@@ -0,0 +1,18 @@
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 查看文件

@@ -0,0 +1,17 @@
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 查看文件

@@ -0,0 +1,12 @@
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 查看文件

@@ -3,7 +3,9 @@ import classnames from 'classnames'
3 3
 import PropTypes from 'prop-types'
4 4
 import { translate } from 'react-i18next'
5 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 10
 const PopinFixedOption = props => {
9 11
   translate.setI18n(props.i18n ? props.i18n : i18n) // mandatory to allow Apps to overrides trad
@@ -11,22 +13,13 @@ const PopinFixedOption = props => {
11 13
   return (
12 14
     <div className={classnames('wsContentGeneric__option', `${props.customClass}__option`)}>
13 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 23
       </div>
31 24
     </div>
32 25
   )