From 83f4fa92a5619afc129dd1098877f4c889dc27c4 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Tue, 20 Nov 2018 10:19:59 -0800 Subject: fix(instant): Autofocus text amount input --- packages/instant/src/components/erc20_asset_amount_input.tsx | 1 + packages/instant/src/components/scaling_amount_input.tsx | 3 +++ packages/instant/src/components/scaling_input.tsx | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'packages/instant') diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx index 520ac33d5..8b4494022 100644 --- a/packages/instant/src/components/erc20_asset_amount_input.tsx +++ b/packages/instant/src/components/erc20_asset_amount_input.tsx @@ -62,6 +62,7 @@ export class ERC20AssetAmountInput extends React.Component void; onFontSizeChange: (fontSizePx: number) => void; + autofocus: boolean; } interface ScalingAmountInputState { stringValue: string; @@ -29,6 +30,7 @@ export class ScalingAmountInput extends React.Component ); } diff --git a/packages/instant/src/components/scaling_input.tsx b/packages/instant/src/components/scaling_input.tsx index e1599a316..c379b76cd 100644 --- a/packages/instant/src/components/scaling_input.tsx +++ b/packages/instant/src/components/scaling_input.tsx @@ -28,6 +28,7 @@ export interface ScalingInputProps { maxLength?: number; scalingSettings: ScalingSettings; isDisabled: boolean; + autofocus: boolean; } export interface ScalingInputState { @@ -51,6 +52,7 @@ export class ScalingInput extends React.Component ); } -- cgit v1.2.3 From cd4600b081b9ee467471174fe6736efab6247759 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Tue, 20 Nov 2018 10:20:16 -0800 Subject: fix(instant): Right align amounts --- packages/instant/src/components/instant_heading.tsx | 4 ++-- packages/instant/src/components/ui/text.tsx | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/src/components/instant_heading.tsx b/packages/instant/src/components/instant_heading.tsx index 002695269..ace577824 100644 --- a/packages/instant/src/components/instant_heading.tsx +++ b/packages/instant/src/components/instant_heading.tsx @@ -107,7 +107,7 @@ export class InstantHeading extends React.Component { private readonly _renderEthAmount = (): React.ReactNode => { return ( - + {format.ethBaseUnitAmount( this.props.totalEthBaseUnitAmount, 4, @@ -119,7 +119,7 @@ export class InstantHeading extends React.Component { private readonly _renderDollarAmount = (): React.ReactNode => { return ( - + {format.ethBaseUnitAmountInUsd( this.props.totalEthBaseUnitAmount, this.props.ethUsdPrice, diff --git a/packages/instant/src/components/ui/text.tsx b/packages/instant/src/components/ui/text.tsx index fd14cc4d1..8e573d7b9 100644 --- a/packages/instant/src/components/ui/text.tsx +++ b/packages/instant/src/components/ui/text.tsx @@ -11,6 +11,7 @@ export interface TextProps { fontSize?: string; opacity?: number; letterSpacing?: string; + textAlign?: string; textTransform?: string; lineHeight?: string; className?: string; @@ -22,6 +23,7 @@ export interface TextProps { noWrap?: boolean; display?: string; href?: string; + width?: string; } export const Text: React.StatelessComponent = ({ href, onClick, ...rest }) => { @@ -51,6 +53,8 @@ export const StyledText = ${props => (props.display ? `display: ${props.display}` : '')}; ${props => (props.letterSpacing ? `letter-spacing: ${props.letterSpacing}` : '')}; ${props => (props.textTransform ? `text-transform: ${props.textTransform}` : '')}; + ${props => (props.textAlign ? `text-align: ${props.textAlign}` : '')}; + ${props => (props.width ? `width: ${props.width}` : '')}; &:hover { ${props => props.onClick ? `color: ${darken(darkenOnHoverAmount, props.theme[props.fontColor || 'white'])}` : ''}; -- cgit v1.2.3 From 2bda6dd719d748a4bfa5ff8e23e97924e0258af1 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Tue, 20 Nov 2018 10:36:23 -0800 Subject: autofocus -> hasAutoFocus --- packages/instant/src/components/erc20_asset_amount_input.tsx | 2 +- packages/instant/src/components/scaling_amount_input.tsx | 6 +++--- packages/instant/src/components/scaling_input.tsx | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) (limited to 'packages/instant') diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx index 8b4494022..ab8c019c7 100644 --- a/packages/instant/src/components/erc20_asset_amount_input.tsx +++ b/packages/instant/src/components/erc20_asset_amount_input.tsx @@ -62,7 +62,7 @@ export class ERC20AssetAmountInput extends React.Component void; onFontSizeChange: (fontSizePx: number) => void; - autofocus: boolean; + hasAutofocus: boolean; } interface ScalingAmountInputState { stringValue: string; @@ -30,7 +30,7 @@ export class ScalingAmountInput extends React.Component ); } diff --git a/packages/instant/src/components/scaling_input.tsx b/packages/instant/src/components/scaling_input.tsx index c379b76cd..129162a74 100644 --- a/packages/instant/src/components/scaling_input.tsx +++ b/packages/instant/src/components/scaling_input.tsx @@ -28,7 +28,7 @@ export interface ScalingInputProps { maxLength?: number; scalingSettings: ScalingSettings; isDisabled: boolean; - autofocus: boolean; + hasAutofocus: boolean; } export interface ScalingInputState { @@ -52,7 +52,7 @@ export class ScalingInput extends React.Component ); } -- cgit v1.2.3 From 10c9d0b723ba190a7f1c4df112ae0c5b37887bb9 Mon Sep 17 00:00:00 2001 From: Steve Klebanoff Date: Wed, 21 Nov 2018 14:24:13 -0800 Subject: Force scaling input component to rerender when a different asset is chosen --- packages/instant/src/components/erc20_asset_amount_input.tsx | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/instant') diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx index 0706833d2..b734af61a 100644 --- a/packages/instant/src/components/erc20_asset_amount_input.tsx +++ b/packages/instant/src/components/erc20_asset_amount_input.tsx @@ -65,6 +65,7 @@ export class ERC20AssetAmountInput extends React.Component Date: Wed, 21 Nov 2018 14:33:12 -0800 Subject: Add comment --- packages/instant/src/components/erc20_asset_amount_input.tsx | 1 + 1 file changed, 1 insertion(+) (limited to 'packages/instant') diff --git a/packages/instant/src/components/erc20_asset_amount_input.tsx b/packages/instant/src/components/erc20_asset_amount_input.tsx index b734af61a..ff900842a 100644 --- a/packages/instant/src/components/erc20_asset_amount_input.tsx +++ b/packages/instant/src/components/erc20_asset_amount_input.tsx @@ -65,6 +65,7 @@ export class ERC20AssetAmountInput extends React.Component -- cgit v1.2.3