Commit ad53b5a8 authored by tom's avatar tom

signature validation

parent cf97a102
export const SIGNATURE_REGEXP = /^0x[a-fA-F\d]{130}$/;
......@@ -41,6 +41,7 @@ const AddressVerificationModal = ({ isOpen, onClose }: Props) => {
const handleClose = React.useCallback(() => {
onClose();
setStepIndex(0);
setError('');
formApi.reset();
}, [ formApi, onClose ]);
......
......@@ -5,6 +5,7 @@ import { Controller, useFormContext } from 'react-hook-form';
import type { AddressVerificationFormFields } from '../types';
import { SIGNATURE_REGEXP } from 'lib/validations/signature';
import InputPlaceholder from 'ui/shared/InputPlaceholder';
const AddressVerificationFieldSignature = () => {
......@@ -32,7 +33,7 @@ const AddressVerificationFieldSignature = () => {
name="signature"
control={ control }
render={ renderControl }
rules={{ required: true }}
rules={{ required: true, pattern: SIGNATURE_REGEXP }}
/>
);
};
......
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