Skip to content

Commit

Permalink
TextArea: conditionally render label (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
christianvuerings committed May 14, 2024
1 parent 1529628 commit 0d4c595
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/itchy-cups-sparkle.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@cambly/syntax-core": minor
---

TextArea: conditionally render label
16 changes: 9 additions & 7 deletions packages/syntax-core/src/TextArea/TextArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,13 +102,15 @@ const TextArea = forwardRef<HTMLTextAreaElement, TextAreaProps>(
}}
position="relative"
>
<label className={textFieldStyles.label} htmlFor={inputId}>
<Box paddingX={1}>
<Typography size={100} color="gray700">
{label}
</Typography>
</Box>
</label>
{label && (
<label className={textFieldStyles.label} htmlFor={inputId}>
<Box paddingX={1}>
<Typography size={100} color="gray700">
{label}
</Typography>
</Box>
</label>
)}
<Typography size={100}>
<textarea
data-testid={dataTestId}
Expand Down

0 comments on commit 0d4c595

Please sign in to comment.