-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: use react-hook-form in all forms (#1049)
* refactor: use react-hook-form in update proposal status modal * refactor: use react-hook-form in grant category section * refactor: use react-hook-form in http status test form * refactor: use react-hook-form in team and budget modals * refactor: use react-hook-form in grant general info submit * refactor: remove assert function from linked-wearables * fix: mobile styles * remove console logs * add function to get all field props in core unit * add function to get all field props in other categories
- Loading branch information
Showing
30 changed files
with
1,160 additions
and
1,244 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import React from 'react' | ||
import { Control, Controller, FieldValues, Path, PathValue } from 'react-hook-form' | ||
|
||
import { | ||
TextAreaField as DCLTextArea, | ||
TextAreaFieldProps, | ||
} from 'decentraland-ui/dist/components/TextAreaField/TextAreaField' | ||
|
||
interface Props<T extends FieldValues> extends TextAreaFieldProps { | ||
control: Control<T> | ||
name: Path<T> | ||
defaultValue?: PathValue<T, Path<T>> | undefined | ||
rules?: any | ||
} | ||
|
||
export default function TextArea<T extends FieldValues>({ | ||
control, | ||
name, | ||
defaultValue, | ||
rules, | ||
...fieldProps | ||
}: Props<T>) { | ||
return ( | ||
<Controller | ||
control={control} | ||
name={name} | ||
defaultValue={defaultValue} | ||
rules={rules} | ||
// eslint-disable-next-line @typescript-eslint/no-unused-vars | ||
render={({ field: { ref, ...field } }) => <DCLTextArea {...field} {...fieldProps} />} | ||
/> | ||
) | ||
} |
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
Oops, something went wrong.