Skip to content

Commit 0242963

Browse files
committed
[#47] ♻️ Apply Highlight component to required prop in Label
1 parent 13ef0b7 commit 0242963

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/common/label/Label.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import clsx from 'clsx'
22

3+
import { Highlight } from '../text'
4+
35
export interface LabelProps
46
extends React.LabelHTMLAttributes<HTMLLabelElement> {
57
required?: boolean
@@ -13,14 +15,13 @@ export const Label = ({
1315
children,
1416
className = '',
1517
}: LabelProps) => {
16-
const labelClass = clsx('flex flex-col', className)
17-
const requiredClass = 'text-body3 font-medium text-primary-normal'
18+
const labelClass = clsx('flex flex-col text-body3 font-medium', className)
1819

1920
return (
2021
<label htmlFor={htmlFor} className={labelClass}>
2122
<div className='mb-4 flex items-center'>
2223
<span className='font-medium text-gray-600'>{labelText}</span>
23-
{required && <span className={requiredClass}>*</span>}
24+
{required && <Highlight>*</Highlight>}
2425
</div>
2526
{children}
2627
</label>

0 commit comments

Comments
 (0)