aboutsummaryrefslogtreecommitdiffstats
path: root/packages/instant/src/components/scaling_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/scaling_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/scaling_amount_input.tsx')
-rw-r--r--packages/instant/src/components/scaling_amount_input.tsx8
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() : ''}