Skip to content

Commit

Permalink
Render label when it's provided (#31)
Browse files Browse the repository at this point in the history
  • Loading branch information
tfirdaus authored Dec 25, 2024
1 parent 07d32ad commit d8fabd8
Showing 1 changed file with 21 additions and 19 deletions.
40 changes: 21 additions & 19 deletions packages/kubrick/src/RadioGroup/RadioGroup.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,25 +66,27 @@ export const RadioGroup = forwardRef<HTMLDivElement, RadioGroupProps>(
data-description-area={descriptionArea}
ref={ref}
>
<span
{...labelProps}
className={clsx({
classNames: classes.label,
prefixedNames: 'label',
})}
>
{label}
{isRequired ?
<span
className={clsx({
classNames: classes.markedRequired,
prefixedNames: 'marked-required',
})}
>
*
</span>
: ''}
</span>
{label && (
<span
{...labelProps}
className={clsx({
classNames: classes.label,
prefixedNames: 'label',
})}
>
{label}
{isRequired ?
<span
className={clsx({
classNames: classes.markedRequired,
prefixedNames: 'marked-required',
})}
>
*
</span>
: ''}
</span>
)}
<RadioContext.Provider value={state}>
<div
className={clsx({
Expand Down

0 comments on commit d8fabd8

Please sign in to comment.