Skip to content

Commit

Permalink
Fix demo component for text input
Browse files Browse the repository at this point in the history
  • Loading branch information
allisonking committed Jan 23, 2025
1 parent 1995b69 commit 7586f01
Showing 1 changed file with 3 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,11 @@ const componentInfo: Record<InputComponent, SchemaComponentData> = {
name: "Input",
placeholder: "For short text",
demoComponent: ({ element }) => {
const isText =
element.schemaName === CoreSchemaType.String ||
element.schemaName === CoreSchemaType.Email;
const isNumber = element.schemaName === CoreSchemaType.Number;
return (
<Input
placeholder={isText ? "For short text" : "For numbers"}
type={isText ? "text" : "number"}
placeholder={isNumber ? "For numbers" : "For short text"}
type={isNumber ? "number" : "text"}
/>
);
},
Expand Down

0 comments on commit 7586f01

Please sign in to comment.