From 473e0738ae3e5d4fc464cfeac26620187fcf008a Mon Sep 17 00:00:00 2001 From: petitPapillon Date: Sun, 4 Jun 2017 21:51:02 +0200 Subject: [PATCH] Decouple jsx out of js - add coin pages --- react/src/components/addcoin/addcoin.js | 198 +----------------- .../src/components/addcoin/addcoin.render.js | 73 +++++++ .../addcoin/render-coin-selectors.render.js | 139 ++++++++++++ 3 files changed, 217 insertions(+), 193 deletions(-) create mode 100644 react/src/components/addcoin/addcoin.render.js create mode 100644 react/src/components/addcoin/render-coin-selectors.render.js diff --git a/react/src/components/addcoin/addcoin.js b/react/src/components/addcoin/addcoin.js index e3f54b0..9d20c85 100644 --- a/react/src/components/addcoin/addcoin.js +++ b/react/src/components/addcoin/addcoin.js @@ -8,9 +8,9 @@ import { shepherdPostCoinList } from '../../actions/actionCreators'; import Store from '../../store'; -import AddCoinOptionsCrypto from './addcoinOptionsCrypto'; -import AddCoinOptionsAC from './addcoinOptionsAC'; -import AddCoinOptionsACFiat from './addcoinOptionsACFiat'; + +import RenderCoinSelectors from './render-coin-selectors.render'; +import AddCoinRender from './addcoin.render'; class AddCoin extends React.Component { constructor(props) { @@ -249,132 +249,7 @@ class AddCoin extends React.Component { const _coin = _item.selectedCoin || ''; items.push( -
-
-
- -
-
-
- -
-
-
- - -
-
- - -
-
- - -
-
-
- -
-
-
- - -
this.toggleSyncOnlyMode(i) }>{ translate('ADD_COIN.SYNC_ONLY') }
-
-
-
-
+ RenderCoinSelectors.call(this, _item, _coin, i) ); } @@ -383,70 +258,7 @@ class AddCoin extends React.Component { render() { return ( -
this.handleKeydown(event) }> - -
-
+ AddCoinRender.call(this) ); } } diff --git a/react/src/components/addcoin/addcoin.render.js b/react/src/components/addcoin/addcoin.render.js new file mode 100644 index 0000000..491aa51 --- /dev/null +++ b/react/src/components/addcoin/addcoin.render.js @@ -0,0 +1,73 @@ +import React from 'react'; +import { translate } from '../../translate/translate'; + +const AddCoinRender = function() { + return ( +
this.handleKeydown(event) }> + +
+
+ ) +}; + +export default AddCoinRender; \ No newline at end of file diff --git a/react/src/components/addcoin/render-coin-selectors.render.js b/react/src/components/addcoin/render-coin-selectors.render.js new file mode 100644 index 0000000..5ce4dcc --- /dev/null +++ b/react/src/components/addcoin/render-coin-selectors.render.js @@ -0,0 +1,139 @@ +import React from 'react'; +import { translate } from '../../translate/translate'; +import AddCoinOptionsCrypto from '../addcoin/addcoinOptionsCrypto'; +import AddCoinOptionsAC from '../addcoin/addcoinOptionsAC'; +import AddCoinOptionsACFiat from '../addcoin/addcoinOptionsACFiat'; + + +const RenderCoinSelectors = function(item, coin, i) { + return ( +
+
+
+ +
+
+
+ +
+
+
+ + +
+
+ + +
+
+ + +
+
+
+ +
+
+
+ + +
this.toggleSyncOnlyMode(i) }>{ translate('ADD_COIN.SYNC_ONLY') }
+
+
+
+
+ ) +}; +export default RenderCoinSelectors; \ No newline at end of file