aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/currency-input/currency-input.container.js
diff options
context:
space:
mode:
authorThomas <thomas.b.huang@gmail.com>2018-10-31 20:55:25 +0800
committerThomas <thomas.b.huang@gmail.com>2018-10-31 20:55:25 +0800
commit7531de14f9575e59b9d0a1b30cf0df46dbc4af67 (patch)
treed9268e89a9fd7e5c6bf3c7c82c195422d7ffa117 /ui/app/components/currency-input/currency-input.container.js
parent611a61b7bc576bb83a6b7851f26d00488fe060f2 (diff)
parentac079365e6b4cf8b19db127e6971fa694fa54fff (diff)
downloadtangerine-wallet-browser-7531de14f9575e59b9d0a1b30cf0df46dbc4af67.tar.gz
tangerine-wallet-browser-7531de14f9575e59b9d0a1b30cf0df46dbc4af67.tar.zst
tangerine-wallet-browser-7531de14f9575e59b9d0a1b30cf0df46dbc4af67.zip
Merge branch 'develop' into reducers
Diffstat (limited to 'ui/app/components/currency-input/currency-input.container.js')
-rw-r--r--ui/app/components/currency-input/currency-input.container.js28
1 files changed, 28 insertions, 0 deletions
diff --git a/ui/app/components/currency-input/currency-input.container.js b/ui/app/components/currency-input/currency-input.container.js
new file mode 100644
index 000000000..1d1ed7b41
--- /dev/null
+++ b/ui/app/components/currency-input/currency-input.container.js
@@ -0,0 +1,28 @@
+import { connect } from 'react-redux'
+import CurrencyInput from './currency-input.component'
+import { ETH } from '../../constants/common'
+
+const mapStateToProps = state => {
+ const { metamask: { nativeCurrency, currentCurrency, conversionRate } } = state
+
+ return {
+ nativeCurrency,
+ currentCurrency,
+ conversionRate,
+ }
+}
+
+const mergeProps = (stateProps, dispatchProps, ownProps) => {
+ const { nativeCurrency, currentCurrency } = stateProps
+ const { useFiat } = ownProps
+ const suffix = useFiat ? currentCurrency.toUpperCase() : nativeCurrency || ETH
+
+ return {
+ ...stateProps,
+ ...dispatchProps,
+ ...ownProps,
+ suffix,
+ }
+}
+
+export default connect(mapStateToProps, null, mergeProps)(CurrencyInput)