Skip to content

Commit

Permalink
Update PlainTextInputElement parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
samad-yar-khan committed Jul 31, 2022
1 parent dc3fc09 commit 674e67d
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const PlainTextInputElement = ({
}: PlainTextInputElementProps): ReactElement => {
const [{ loading, value, error }, action] = useUiKitState(block, context);

if (block.multilineLarge) {
if (block.multiline && block.multilineSize === 'large') {
return (
<TextAreaInput
disabled={loading}
Expand All @@ -35,7 +35,7 @@ const PlainTextInputElement = ({
);
}

if (block.multilineMedium) {
if (block.multiline && block.multilineSize === 'medium') {
return (
<TextAreaInput
disabled={loading}
Expand All @@ -54,7 +54,7 @@ const PlainTextInputElement = ({
);
}

if (block.multiline || block.multilineSmall) {
if (block.multiline || (block.multiline && block.multilineSize === 'small')) {
return (
<TextAreaInput
disabled={loading}
Expand Down
7 changes: 5 additions & 2 deletions packages/fuselage-ui-kit/src/stories/payloads/input.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export const inputWithMultilinePlainTextInput: readonly UiKit.LayoutBlock[] = [
blockId: 'dummy-block-id',
type: 'plain_text_input',
multiline: true,
multilineSize: 'small',
actionId: 'input-0',
},
label: {
Expand All @@ -26,7 +27,8 @@ export const inputWithMediumMultilinePlainTextInput: readonly UiKit.LayoutBlock[
appId: 'dummy-app-id',
blockId: 'dummy-block-id',
type: 'plain_text_input',
multilineMedium: true,
multiline: true,
multilineSize: 'medium',
actionId: 'input-0',
},
label: {
Expand All @@ -45,7 +47,8 @@ export const inputWithLargeMultilinePlainTextInput: readonly UiKit.LayoutBlock[]
appId: 'dummy-app-id',
blockId: 'dummy-block-id',
type: 'plain_text_input',
multilineLarge: true,
multiline: true,
multilineSize: 'large',
actionId: 'input-0',
},
label: {
Expand Down
4 changes: 1 addition & 3 deletions packages/ui-kit/src/blocks/elements/PlainTextInputElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,5 @@ export type PlainTextInputElement = Actionable<{
multiline?: boolean;
minLength?: number;
maxLength?: number;
multilineLarge?: boolean;
multilineMedium?: boolean;
multilineSmall?: boolean;
multilineSize?: 'large' | 'medium' | 'small';
}>;

0 comments on commit 674e67d

Please sign in to comment.