From 130e83d9b27cb541cf4f07b3d75fcfeea076df41 Mon Sep 17 00:00:00 2001 From: Brandon Millman Date: Mon, 21 May 2018 21:15:41 -0700 Subject: Use flexbox for wrapped ether item --- .../ts/components/wallet/wrap_ether_item.tsx | 50 +++++++++++++--------- 1 file changed, 29 insertions(+), 21 deletions(-) (limited to 'packages') diff --git a/packages/website/ts/components/wallet/wrap_ether_item.tsx b/packages/website/ts/components/wallet/wrap_ether_item.tsx index 98b28b3ad..aab1d4439 100644 --- a/packages/website/ts/components/wallet/wrap_ether_item.tsx +++ b/packages/website/ts/components/wallet/wrap_ether_item.tsx @@ -37,7 +37,10 @@ interface WrapEtherItemState { } const styles: Styles = { - topLabel: { color: colors.black, fontSize: 11 }, + topLabel: { + color: colors.black, + fontSize: 11, + }, inputContainer: { backgroundColor: colors.white, borderBottomRightRadius: 3, @@ -45,9 +48,10 @@ const styles: Styles = { borderTopRightRadius: 3, borderTopLeftRadius: 3, padding: 4, - width: 125, }, - amountInput: { height: 34 }, + amountInput: { + height: 34, + }, amountInputLabel: { paddingTop: 10, paddingRight: 10, @@ -58,8 +62,6 @@ const styles: Styles = { amountInputHint: { bottom: 18, }, - innerDiv: { paddingLeft: 60, paddingTop: 0, paddingBottom: 10 }, - wrapEtherConfirmationButtonContainer: { width: 128, top: 19 }, wrapEtherConfirmationButtonLabel: { fontSize: 12, color: colors.white, @@ -70,6 +72,12 @@ const styles: Styles = { color: colors.red, minHeight: 20, }, + conversionSpinner: { + paddingTop: 26, + }, + conversionSpinnerPlaceholder: { + width: 61, + }, }; export class WrapEtherItem extends React.Component { @@ -85,11 +93,13 @@ export class WrapEtherItem extends React.Component -
{topLabelText}
+
+
{this._renderIsEthConversionHappeningSpinner()}
+
+
{topLabelText}
+
{isWrappingEth ? ( )}
- {this._renderErrorMsg()} +
{this._renderWrapEtherConfirmationButton()}
- } - secondaryTextLines={2} - disableTouchRipple={true} - style={walletItemStyles.focusedItem} - innerDivStyle={styles.innerDiv} - leftIcon={this._renderIsEthConversionHappeningSpinner()} - rightAvatar={this._renderWrapEtherConfirmationButton()} - /> + + {this._renderErrorMsg()} +
+
); } private _onValueChange(isValid: boolean, amount?: BigNumber): void { @@ -152,16 +158,18 @@ export class WrapEtherItem extends React.Component { return this.state.isEthConversionHappening ? ( -
+
- ) : null; + ) : ( +
+ ); } private _renderWrapEtherConfirmationButton(): React.ReactElement<{}> { const isWrappingEth = this.props.direction === Side.Deposit; const labelText = isWrappingEth ? 'wrap' : 'unwrap'; return ( -
+