Skip to content

Commit a490f3b

Browse files
committed
refactor(CFormLabel): change classNameParent prop to customClassName
1 parent 6fd1da6 commit a490f3b

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/components/form/CFormLabel.tsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,15 @@ export interface CFormLabelProps extends HTMLAttributes<HTMLLabelElement> {
77
* A string of all className you want applied to the component. [docs]
88
*/
99
className?: string
10-
classNameParent?: string
10+
/**
11+
* A string of all className you want to be applied to the component, and override standard className value. [docs]
12+
*/
13+
customClassName?: string
1114
}
1215

1316
export const CFormLabel = forwardRef<HTMLLabelElement, CFormLabelProps>(
14-
({ children, className, classNameParent, ...rest }, ref) => {
15-
const _className = classNameParent ? classNameParent : classNames('form-label', className)
17+
({ children, className, customClassName, ...rest }, ref) => {
18+
const _className = customClassName ? customClassName : classNames('form-label', className)
1619
return (
1720
<label className={_className} {...rest} ref={ref}>
1821
{children}
@@ -24,7 +27,7 @@ export const CFormLabel = forwardRef<HTMLLabelElement, CFormLabelProps>(
2427
CFormLabel.propTypes = {
2528
children: PropTypes.node,
2629
className: PropTypes.string,
27-
classNameParent: PropTypes.string,
30+
customClassName: PropTypes.string,
2831
}
2932

3033
CFormLabel.displayName = 'CFormLabel'

0 commit comments

Comments
 (0)