aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/containers/selected_asset_instant_heading.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/instant/src/containers/selected_asset_instant_heading.ts')
-rw-r--r--packages/instant/src/containers/selected_asset_instant_heading.ts30
1 files changed, 30 insertions, 0 deletions
diff --git a/packages/instant/src/containers/selected_asset_instant_heading.ts b/packages/instant/src/containers/selected_asset_instant_heading.ts
new file mode 100644
index 000000000..be31527f1
--- /dev/null
+++ b/packages/instant/src/containers/selected_asset_instant_heading.ts
@@ -0,0 +1,30 @@
+import { BigNumber } from '@0xproject/utils';
+import * as _ from 'lodash';
+import * as React from 'react';
+import { connect } from 'react-redux';
+import { oc } from 'ts-optchain';
+
+import { State } from '../redux/reducer';
+import { AsyncProcessState } from '../types';
+
+import { InstantHeading } from '../components/instant_heading';
+
+export interface InstantHeadingProps {}
+
+interface ConnectedState {
+ selectedAssetAmount?: BigNumber;
+ totalEthBaseAmount?: BigNumber;
+ ethUsdPrice?: BigNumber;
+ quoteState: AsyncProcessState;
+}
+
+const mapStateToProps = (state: State, _ownProps: InstantHeadingProps): ConnectedState => ({
+ selectedAssetAmount: state.selectedAssetAmount,
+ totalEthBaseAmount: oc(state).latestBuyQuote.worstCaseQuoteInfo.totalEthAmount(),
+ ethUsdPrice: state.ethUsdPrice,
+ quoteState: state.quoteState,
+});
+
+export const SelectedAssetInstantHeading: React.ComponentClass<InstantHeadingProps> = connect(mapStateToProps)(
+ InstantHeading,
+);