File tree Expand file tree Collapse file tree 1 file changed +45
-34
lines changed
packages/coreui-react/src/components/form Expand file tree Collapse file tree 1 file changed +45
-34
lines changed Original file line number Diff line number Diff line change @@ -154,41 +154,52 @@ export const CFormCheck = forwardRef<HTMLInputElement, CFormCheckProps>(
154154 </ CFormLabel >
155155 )
156156
157- return button ? (
158- < >
159- < FormControl />
160- { label && < FormLabel /> }
161- < FormValidation />
162- </ >
163- ) : label ? (
164- hitArea ? (
165- < >
166- < CFormLabel customClassName = { className } { ...( id && { htmlFor : id } ) } >
157+ const FormCheck = ( ) => {
158+ if ( button ) {
159+ return (
160+ < >
167161 < FormControl />
168- { label }
169- </ CFormLabel >
170- < FormValidation />
171- </ >
172- ) : (
173- < div
174- className = { classNames (
175- 'form-check' ,
176- {
177- 'form-check-inline' : inline ,
178- 'is-invalid' : invalid ,
179- 'is-valid' : valid ,
180- } ,
181- className ,
182- ) }
183- >
184- < FormControl />
185- < FormLabel />
186- < FormValidation />
187- </ div >
188- )
189- ) : (
190- < FormControl />
191- )
162+ { label && < FormLabel /> }
163+ < FormValidation />
164+ </ >
165+ )
166+ }
167+
168+ if ( label ) {
169+ return hitArea ? (
170+ < >
171+ < FormControl />
172+ < CFormLabel
173+ customClassName = { classNames ( 'form-check-label stretched-link' , className ) }
174+ { ...( id && { htmlFor : id } ) }
175+ >
176+ { label }
177+ </ CFormLabel >
178+ < FormValidation />
179+ </ >
180+ ) : (
181+ < div
182+ className = { classNames (
183+ 'form-check' ,
184+ {
185+ 'form-check-inline' : inline ,
186+ 'is-invalid' : invalid ,
187+ 'is-valid' : valid ,
188+ } ,
189+ className ,
190+ ) }
191+ >
192+ < FormControl />
193+ < FormLabel />
194+ < FormValidation />
195+ </ div >
196+ )
197+ }
198+
199+ return < FormControl />
200+ }
201+
202+ return < FormCheck />
192203 } ,
193204)
194205
You can’t perform that action at this time.
0 commit comments