Skip to content

Commit

Permalink
fix(TextInput): beforeComponent Icon only allow 20px size icons TET-348
Browse files Browse the repository at this point in the history
  • Loading branch information
adrian-potepa committed Nov 15, 2023
1 parent 9801bf4 commit e305926
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/components/TextInput/TextInput.props.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { IconProps } from '@virtuslab/tetrisly-icons';
import { InputHTMLAttributes } from 'react';

import { TextInputConfig } from './TextInput.styles';
Expand All @@ -9,9 +8,10 @@ import { GhostIconButtonProps } from '../IconButton/IconButton.props';

import type { BasicInputState } from '@/types';
import { InnerComponent } from '@/types/InnerComponent';
import { IconName } from '@/utility-types/IconName';

export namespace TextInputProps.InnerComponents {
export type Icon = InnerComponent<'Icon', IconProps>;
export type Icon = InnerComponent<'Icon', { name: IconName<20> }>;
export type IconButton = InnerComponent<
'IconButton',
Omit<GhostIconButtonProps, 'variant' | 'size'>
Expand Down
4 changes: 2 additions & 2 deletions src/components/TextInput/TextInput.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ describe('TextInput', () => {
it('should render beforeComponent', () => {
const { textInput } = getTextInput(
<TextInput
beforeComponent={{ type: 'Icon', props: { name: '16-bolt' } }}
beforeComponent={{ type: 'Icon', props: { name: '20-bolt' } }}
/>,
);

Expand All @@ -90,7 +90,7 @@ describe('TextInput', () => {
it('should render afterComponent', () => {
const { textInput } = getTextInput(
<TextInput
afterComponent={{ type: 'Icon', props: { name: '16-bolt' } }}
afterComponent={{ type: 'Icon', props: { name: '20-bolt' } }}
/>,
);

Expand Down

0 comments on commit e305926

Please sign in to comment.