diff options
author | Dan <danjm.com@gmail.com> | 2018-05-01 10:42:57 +0800 |
---|---|---|
committer | Dan <danjm.com@gmail.com> | 2018-05-01 10:42:57 +0800 |
commit | 2f78fffbdbb0e41d73bcde2c15c88fff095614b7 (patch) | |
tree | 24d68a267304d085ee1b7c705ce5ade53c9439c3 /ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js | |
parent | f96c13d616e429447ac0a6a24c6aeee902162b88 (diff) | |
parent | 954394f81090b1a6a4afe55243caa3671b88addc (diff) | |
download | tangerine-wallet-browser-2f78fffbdbb0e41d73bcde2c15c88fff095614b7.tar.gz tangerine-wallet-browser-2f78fffbdbb0e41d73bcde2c15c88fff095614b7.tar.zst tangerine-wallet-browser-2f78fffbdbb0e41d73bcde2c15c88fff095614b7.zip |
Merge branch 'i3725-refactor-send-component-' into i3725-refactor-send-component-2
Diffstat (limited to 'ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js')
-rw-r--r-- | ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js b/ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js index a1ac591b9..707b3ae80 100644 --- a/ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js +++ b/ui/app/components/send_/send-content/send-row-wrapper/send-row-wrapper.component.js @@ -5,31 +5,35 @@ import SendRowErrorMessage from './send-row-error-message/send-row-error-message export default class SendRowWrapper extends Component { static propTypes = { - label: PropTypes.string, - showError: PropTypes.bool, children: PropTypes.node, errorType: PropTypes.string, + label: PropTypes.string, + showError: PropTypes.bool, }; render () { const { - label, - errorType = '', - showError = false, - children, + children, + errorType = '', + label, + showError = false, } = this.props + const formField = Array.isArray(children) ? children[1] || children[0] : children + const customLabelContent = children.length > 1 ? children[0] : null + return ( <div className="send-v2__form-row"> <div className="send-v2__form-label"> {label} - (showError && <SendRowErrorMessage errorType={errorType}/>) + {showError && <SendRowErrorMessage errorType={errorType}/>} + {customLabelContent} </div> <div className="send-v2__form-field"> - {children} + {formField} </div> </div> - ); + ) } } |