Skip to content

Commit

Permalink
Merge pull request #2373 from skbkontur/fx-input-sizes
Browse files Browse the repository at this point in the history
Изменение размера кнопки в FxInput при передаче пропа size
  • Loading branch information
zhzz authored May 10, 2021
2 parents 4e3e770 + c85a335 commit 85c4c07
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 2 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion packages/react-ui/components/FxInput/FxInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ export class FxInput extends React.Component<FxInputProps> {
inputProps.leftIcon = <FunctionIcon />;
} else {
button = (
<Button narrow onClick={this.props.onRestore} borderless={this.props.borderless} disabled={this.props.disabled}>
<Button
size={this.props.size}
narrow
onClick={this.props.onRestore}
borderless={this.props.borderless}
disabled={this.props.disabled}
>
<UndoIcon />
</Button>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,24 @@ import { CSFStory } from 'creevey';

import { BGRuler } from '../../../internal/BGRuler';
import { FxInput } from '../FxInput';
import { Gapped } from '../../Gapped';
import { createPropsGetter } from '../../../lib/createPropsGetter';
import { InputType } from '../../Input';
import { InputSize, InputType } from '../../Input';

export default { title: 'FxInput' };

export const TypeText = () => <TestFxInput />;
TypeText.story = { name: 'type text' };

export const DifferentSizesFxInput = () => (
<Gapped vertical>
<TestFxInput size="small" />
<TestFxInput size="medium" />
<TestFxInput size="large" />
</Gapped>
);
DifferentSizesFxInput.story = { name: 'different sizes' };

export const TypeCurrency = () => <TestFxInput type={'currency'} fractionDigits={4} />;
TypeCurrency.story = { name: 'type currency' };

Expand Down Expand Up @@ -54,6 +64,7 @@ interface TestFxInputProps {
autoFocus?: boolean;
borderless?: boolean;
fractionDigits?: number;
size?: InputSize;
}

interface TestFxInputState {
Expand Down Expand Up @@ -86,6 +97,7 @@ class TestFxInput extends React.Component<TestFxInputProps, TestFxInputState> {
value={this.state.value}
onRestore={this.handleRestore}
onValueChange={this.handleChange}
size={this.props.size}
/>
);
}
Expand Down

0 comments on commit 85c4c07

Please sign in to comment.