mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
validations folder
This commit is contained in:
@@ -0,0 +1 @@
|
||||
export const EMAIL_REGEXP = /^[\w.%+-]+@[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)+$/;
|
||||
@@ -14,7 +14,7 @@ import { useForm, Controller } from 'react-hook-form';
|
||||
|
||||
import type { CustomAbi, CustomAbis } from 'types/api/account';
|
||||
|
||||
import { ADDRESS_REGEXP } from 'lib/addressValidations';
|
||||
import { ADDRESS_REGEXP } from 'lib/validations/address';
|
||||
import AddressInput from 'ui/shared/AddressInput';
|
||||
|
||||
type Props = {
|
||||
|
||||
@@ -10,7 +10,7 @@ import { useForm, Controller } from 'react-hook-form';
|
||||
|
||||
import type { AddressTag } from 'types/api/account';
|
||||
|
||||
import { ADDRESS_REGEXP } from 'lib/addressValidations';
|
||||
import { ADDRESS_REGEXP } from 'lib/validations/address';
|
||||
import AddressInput from 'ui/shared/AddressInput';
|
||||
import TagInput from 'ui/shared/TagInput';
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ import { useForm, Controller } from 'react-hook-form';
|
||||
|
||||
import type { TransactionTag } from 'types/api/account';
|
||||
|
||||
import { TRANSACTION_HASH_LENGTH, TRANSACTION_HASH_REGEXP } from 'lib/transactionValidations';
|
||||
import { TRANSACTION_HASH_LENGTH, TRANSACTION_HASH_REGEXP } from 'lib/validations/transaction';
|
||||
import TagInput from 'ui/shared/TagInput';
|
||||
import TransactionInput from 'ui/shared/TransactionInput';
|
||||
|
||||
|
||||
@@ -5,7 +5,7 @@ import { Controller } from 'react-hook-form';
|
||||
|
||||
import MinusIcon from 'icons/minus.svg';
|
||||
import PlusIcon from 'icons/plus.svg';
|
||||
import { ADDRESS_REGEXP } from 'lib/addressValidations';
|
||||
import { ADDRESS_REGEXP } from 'lib/validations/address';
|
||||
import AddressInput from 'ui/shared/AddressInput';
|
||||
|
||||
import type { Inputs } from './PublicTagsForm';
|
||||
|
||||
@@ -11,6 +11,7 @@ import type { Path } from 'react-hook-form';
|
||||
import { useForm, useFieldArray } from 'react-hook-form';
|
||||
|
||||
import type { TPublicTagItem, TPublicTag, TPublicTagAddress } from 'data/publicTags';
|
||||
import { EMAIL_REGEXP } from 'lib/validations/email';
|
||||
|
||||
import PublicTagFormAction from './PublicTagFormAction';
|
||||
import PublicTagFormAddressInput from './PublicTagFormAddressInput';
|
||||
@@ -98,7 +99,7 @@ const PublicTagsForm = ({ changeToDataScreen, data }: Props) => {
|
||||
fieldName="userEmail"
|
||||
control={ control }
|
||||
label={ placeholders.userEmail }
|
||||
pattern={ /^[\w.%+-]+@[a-zA-Z\d-]+(?:\.[a-zA-Z\d-]+)+$/ }
|
||||
pattern={ EMAIL_REGEXP }
|
||||
hasError={ Boolean(errors.userEmail) }
|
||||
required
|
||||
/>
|
||||
|
||||
@@ -6,7 +6,7 @@ import {
|
||||
import React from 'react';
|
||||
import type { ControllerRenderProps, FieldValues, Path } from 'react-hook-form';
|
||||
|
||||
import { ADDRESS_LENGTH } from 'lib/addressValidations';
|
||||
import { ADDRESS_LENGTH } from 'lib/validations/address';
|
||||
|
||||
type Props<TInputs extends FieldValues, TInputName extends Path<TInputs>> = {
|
||||
field: ControllerRenderProps<TInputs, TInputName>;
|
||||
|
||||
@@ -14,7 +14,7 @@ import { useForm, Controller } from 'react-hook-form';
|
||||
|
||||
import type { TWatchlistItem } from 'types/client/account';
|
||||
|
||||
import { ADDRESS_REGEXP } from 'lib/addressValidations';
|
||||
import { ADDRESS_REGEXP } from 'lib/validations/address';
|
||||
import AddressInput from 'ui/shared/AddressInput';
|
||||
import TagInput from 'ui/shared/TagInput';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user