diff options
author | fragosti <francesco.agosti93@gmail.com> | 2018-10-23 07:45:48 +0800 |
---|---|---|
committer | fragosti <francesco.agosti93@gmail.com> | 2018-10-23 07:45:48 +0800 |
commit | 921492e8186697e477c27d76bd7eb58ce2454765 (patch) | |
tree | 7b30f9a4f5d40cafc4bbc60c7b1e02ae64de52d4 /packages/instant/src/components/scaling_amount_input.tsx | |
parent | 77a4d7e2b76a1808c37ed9f0a97cbd3b34a0ebe9 (diff) | |
download | dexon-0x-contracts-921492e8186697e477c27d76bd7eb58ce2454765.tar.gz dexon-0x-contracts-921492e8186697e477c27d76bd7eb58ce2454765.tar.zst dexon-0x-contracts-921492e8186697e477c27d76bd7eb58ce2454765.zip |
feature: reduce font size by a percentage instead of a constant
Diffstat (limited to 'packages/instant/src/components/scaling_amount_input.tsx')
-rw-r--r-- | packages/instant/src/components/scaling_amount_input.tsx | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/packages/instant/src/components/scaling_amount_input.tsx b/packages/instant/src/components/scaling_amount_input.tsx index a0b7b74af..83375af00 100644 --- a/packages/instant/src/components/scaling_amount_input.tsx +++ b/packages/instant/src/components/scaling_amount_input.tsx @@ -9,12 +9,13 @@ import { ScalingInput } from './scaling_input'; import { Container, Text } from './ui'; export interface ScalingAmountInputProps { - fontSizePx: number; + maxFontSizePx: number; startWidthCh: number; endWidthCh: number; fontColor?: ColorOption; value?: BigNumber; onChange: (value?: BigNumber, fontSize?: number) => void; + onFontSizeChange: (fontSizePx: number) => void; } export class ScalingAmountInput extends React.Component<ScalingAmountInputProps> { @@ -23,12 +24,13 @@ export class ScalingAmountInput extends React.Component<ScalingAmountInputProps> onFontSizeChange: util.boundNoop, }; public render(): React.ReactNode { - const { startWidthCh, endWidthCh, fontColor, fontSizePx, value } = this.props; + const { startWidthCh, endWidthCh, fontColor, maxFontSizePx, value, onFontSizeChange } = this.props; return ( <ScalingInput startWidthCh={startWidthCh} endWidthCh={endWidthCh} - fontSizePx={fontSizePx} + maxFontSizePx={maxFontSizePx} + onFontSizeChange={onFontSizeChange} fontColor={fontColor} onChange={this._handleChange} value={!_.isUndefined(value) ? value.toString() : ''} |