Commit dd691ec8 authored by tom's avatar tom

ts fix

parent b215ee95
......@@ -8,12 +8,12 @@ import type { ControllerRenderProps, FieldValues } from 'react-hook-form';
const TAG_MAX_LENGTH = 35;
type Props = {
field: ControllerRenderProps<FieldValues, 'tag'>;
type Props<Field> = {
field: Field;
isInvalid: boolean;
}
const TagInput: React.FC<Props> = ({ field, isInvalid }) => {
function TagInput<Field extends Partial<ControllerRenderProps<FieldValues, 'tag'>>>({ field, isInvalid }: Props<Field>) {
return (
<FormControl variant="floating" id="tag" isRequired>
<Input
......@@ -24,6 +24,6 @@ const TagInput: React.FC<Props> = ({ field, isInvalid }) => {
<FormLabel>Private tag (max 35 characters)</FormLabel>
</FormControl>
);
};
}
export default TagInput;
......@@ -8,12 +8,12 @@ import type { ControllerRenderProps, FieldValues } from 'react-hook-form';
const HASH_LENGTH = 66;
type Props = {
field: ControllerRenderProps<FieldValues, 'transaction'>;
type Props<Field> = {
field: Field;
isInvalid: boolean;
}
const AddressInput: React.FC<Props> = ({ field, isInvalid }) => {
function AddressInput<Field extends Partial<ControllerRenderProps<FieldValues, 'transaction'>>>({ field, isInvalid }: Props<Field>) {
return (
<FormControl variant="floating" id="transaction" isRequired>
<Input
......@@ -24,6 +24,6 @@ const AddressInput: React.FC<Props> = ({ field, isInvalid }) => {
<FormLabel>Transaction hash (0x...)</FormLabel>
</FormControl>
);
};
}
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