-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(create-forms): 🎉 update form fields
- Loading branch information
1 parent
54938b0
commit b276f8f
Showing
3 changed files
with
67 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import React, { ReactElement } from "react"; | ||
import InputSelect from "../InputSelect/InputSelect"; | ||
import InputError from "../InputError/InputError"; | ||
import InfoTip from "../InfoTip/InfoTip"; | ||
|
||
interface IFormInputSelect { | ||
labelText: string; | ||
InfoTipText: string; | ||
formikProps: any; | ||
disabled?: boolean; | ||
validationError?: any; | ||
validationTouched?: any; | ||
children?: ReactElement | ReactElement[]; | ||
} | ||
|
||
export default function FormInputSelect({ | ||
labelText, | ||
InfoTipText, | ||
formikProps, | ||
disabled, | ||
validationError, | ||
validationTouched, | ||
children, | ||
}: IFormInputSelect): ReactElement { | ||
return ( | ||
<div className="flex flex-col gap-2"> | ||
<div className="flex gap-1 min-w-fit text-xs font-medium text-layer-light-700"> | ||
{labelText} | ||
<InfoTip content={InfoTipText} /> | ||
</div> | ||
<InputSelect {...formikProps} disabled={disabled}> | ||
{children} | ||
</InputSelect> | ||
<InputError error={validationError} touched={validationTouched} /> | ||
</div> | ||
); | ||
} |