Commit dd691ec8 authored by tom's avatar tom

ts fix

parent b215ee95
...@@ -8,12 +8,12 @@ import type { ControllerRenderProps, FieldValues } from 'react-hook-form'; ...@@ -8,12 +8,12 @@ import type { ControllerRenderProps, FieldValues } from 'react-hook-form';
const TAG_MAX_LENGTH = 35; const TAG_MAX_LENGTH = 35;
type Props = { type Props<Field> = {
field: ControllerRenderProps<FieldValues, 'tag'>; field: Field;
isInvalid: boolean; isInvalid: boolean;
} }
const TagInput: React.FC<Props> = ({ field, isInvalid }) => { function TagInput<Field extends Partial<ControllerRenderProps<FieldValues, 'tag'>>>({ field, isInvalid }: Props<Field>) {
return ( return (
<FormControl variant="floating" id="tag" isRequired> <FormControl variant="floating" id="tag" isRequired>
<Input <Input
...@@ -24,6 +24,6 @@ const TagInput: React.FC<Props> = ({ field, isInvalid }) => { ...@@ -24,6 +24,6 @@ const TagInput: React.FC<Props> = ({ field, isInvalid }) => {
<FormLabel>Private tag (max 35 characters)</FormLabel> <FormLabel>Private tag (max 35 characters)</FormLabel>
</FormControl> </FormControl>
); );
}; }
export default TagInput; export default TagInput;
...@@ -8,12 +8,12 @@ import type { ControllerRenderProps, FieldValues } from 'react-hook-form'; ...@@ -8,12 +8,12 @@ import type { ControllerRenderProps, FieldValues } from 'react-hook-form';
const HASH_LENGTH = 66; const HASH_LENGTH = 66;
type Props = { type Props<Field> = {
field: ControllerRenderProps<FieldValues, 'transaction'>; field: Field;
isInvalid: boolean; isInvalid: boolean;
} }
const AddressInput: React.FC<Props> = ({ field, isInvalid }) => { function AddressInput<Field extends Partial<ControllerRenderProps<FieldValues, 'transaction'>>>({ field, isInvalid }: Props<Field>) {
return ( return (
<FormControl variant="floating" id="transaction" isRequired> <FormControl variant="floating" id="transaction" isRequired>
<Input <Input
...@@ -24,6 +24,6 @@ const AddressInput: React.FC<Props> = ({ field, isInvalid }) => { ...@@ -24,6 +24,6 @@ const AddressInput: React.FC<Props> = ({ field, isInvalid }) => {
<FormLabel>Transaction hash (0x...)</FormLabel> <FormLabel>Transaction hash (0x...)</FormLabel>
</FormControl> </FormControl>
); );
}; }
export default AddressInput; export default AddressInput;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment