aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/balance/balance.container.js
diff options
context:
space:
mode:
authorAlexander Tseung <alextsg@users.noreply.github.com>2019-01-21 22:26:48 +0800
committerWhymarrh Whitby <whymarrh.whitby@gmail.com>2019-01-21 22:26:48 +0800
commitfe780fb3d457dd22be84cf7ef386327ba9a2ec93 (patch)
tree3efc262ab19b4ea8ba5a0cde985189d6547ebb95 /ui/app/components/balance/balance.container.js
parent0ad77970762ac5389e264ce70f633dddd8d58844 (diff)
downloadtangerine-wallet-browser-fe780fb3d457dd22be84cf7ef386327ba9a2ec93.tar.gz
tangerine-wallet-browser-fe780fb3d457dd22be84cf7ef386327ba9a2ec93.tar.zst
tangerine-wallet-browser-fe780fb3d457dd22be84cf7ef386327ba9a2ec93.zip
Refactor BalanceComponent to jsx (#6048)
Diffstat (limited to 'ui/app/components/balance/balance.container.js')
-rw-r--r--ui/app/components/balance/balance.container.js27
1 files changed, 27 insertions, 0 deletions
diff --git a/ui/app/components/balance/balance.container.js b/ui/app/components/balance/balance.container.js
new file mode 100644
index 000000000..b8c3a04cc
--- /dev/null
+++ b/ui/app/components/balance/balance.container.js
@@ -0,0 +1,27 @@
+import { connect } from 'react-redux'
+import Balance from './balance.component'
+import {
+ getNativeCurrency,
+ getAssetImages,
+ conversionRateSelector,
+ getCurrentCurrency,
+ getMetaMaskAccounts,
+} from '../../selectors'
+
+const mapStateToProps = state => {
+ const accounts = getMetaMaskAccounts(state)
+ const network = state.metamask.network
+ const selectedAddress = state.metamask.selectedAddress || Object.keys(accounts)[0]
+ const account = accounts[selectedAddress]
+
+ return {
+ account,
+ network,
+ nativeCurrency: getNativeCurrency(state),
+ conversionRate: conversionRateSelector(state),
+ currentCurrency: getCurrentCurrency(state),
+ assetImages: getAssetImages(state),
+ }
+}
+
+export default connect(mapStateToProps)(Balance)