File tree Expand file tree Collapse file tree 1 file changed +12
-2
lines changed
src/components/common/label Expand file tree Collapse file tree 1 file changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -6,20 +6,30 @@ export interface LabelProps
66 extends React . LabelHTMLAttributes < HTMLLabelElement > {
77 required ?: boolean
88 labelText ?: string
9+ layout ?: 'col' | 'row'
910}
1011
1112export const Label = ( {
1213 required = false ,
1314 labelText,
15+ layout = 'col' ,
1416 htmlFor,
1517 children,
1618 className = '' ,
1719} : LabelProps ) : JSX . Element => {
18- const labelClass = clsx ( 'flex flex-col text-body3 font-medium' , className )
20+ const labelClass = clsx (
21+ 'flex text-body3 font-medium' ,
22+ layout === 'col' ? 'flex-col' : 'flex-row' ,
23+ className
24+ )
25+ const labelTextClass = clsx (
26+ 'flex items-center' ,
27+ layout === 'col' ? 'mb-4' : ''
28+ )
1929
2030 return (
2131 < label htmlFor = { htmlFor } className = { labelClass } >
22- < div className = 'mb-4 flex items-center' >
32+ < div className = { labelTextClass } >
2333 < span className = 'font-medium text-gray-600' > { labelText } </ span >
2434 { required && < Highlight > *</ Highlight > }
2535 </ div >
You can’t perform that action at this time.
0 commit comments