aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/asset_amount_input.tsx
diff options
context:
space:
mode:
authorfragosti <francesco.agosti93@gmail.com>2018-10-23 07:45:48 +0800
committerfragosti <francesco.agosti93@gmail.com>2018-10-23 07:45:48 +0800
commit921492e8186697e477c27d76bd7eb58ce2454765 (patch)
tree7b30f9a4f5d40cafc4bbc60c7b1e02ae64de52d4 /packages/instant/src/components/asset_amount_input.tsx
parent77a4d7e2b76a1808c37ed9f0a97cbd3b34a0ebe9 (diff)
downloaddexon-sol-tools-921492e8186697e477c27d76bd7eb58ce2454765.tar
dexon-sol-tools-921492e8186697e477c27d76bd7eb58ce2454765.tar.gz
dexon-sol-tools-921492e8186697e477c27d76bd7eb58ce2454765.tar.bz2
dexon-sol-tools-921492e8186697e477c27d76bd7eb58ce2454765.tar.lz
dexon-sol-tools-921492e8186697e477c27d76bd7eb58ce2454765.tar.xz
dexon-sol-tools-921492e8186697e477c27d76bd7eb58ce2454765.tar.zst
dexon-sol-tools-921492e8186697e477c27d76bd7eb58ce2454765.zip
feature: reduce font size by a percentage instead of a constant
Diffstat (limited to 'packages/instant/src/components/asset_amount_input.tsx')
-rw-r--r--packages/instant/src/components/asset_amount_input.tsx15
1 files changed, 8 insertions, 7 deletions
diff --git a/packages/instant/src/components/asset_amount_input.tsx b/packages/instant/src/components/asset_amount_input.tsx
index 0b22c889c..beb21a4cf 100644
--- a/packages/instant/src/components/asset_amount_input.tsx
+++ b/packages/instant/src/components/asset_amount_input.tsx
@@ -41,8 +41,9 @@ export class AssetAmountInput extends React.Component<AssetAmountInputProps, Ass
{...rest}
startWidthCh={3.5}
endWidthCh={5}
- fontSizePx={this.state.currentFontSizePx}
+ maxFontSizePx={this.props.startingFontSizePx}
onChange={this._handleChange}
+ onFontSizeChange={this._handleFontSizeChange}
/>
</Container>
<Container display="inline-block" marginLeft="10px">
@@ -57,12 +58,12 @@ export class AssetAmountInput extends React.Component<AssetAmountInputProps, Ass
</Container>
);
}
- private readonly _handleChange = (value?: BigNumber, fontSize?: number): void => {
+ private readonly _handleChange = (value?: BigNumber): void => {
this.props.onChange(value, this.props.asset);
- if (!_.isUndefined(fontSize)) {
- this.setState({
- currentFontSizePx: fontSize,
- });
- }
+ };
+ private readonly _handleFontSizeChange = (fontSizePx: number): void => {
+ this.setState({
+ currentFontSizePx: fontSizePx,
+ });
};
}