Commit 06df563b authored by Viacheslav Pavlov's avatar Viacheslav Pavlov
Browse files

Partner email address

parent 793ad5e3
......@@ -81,7 +81,7 @@ class PartnerForm extends React.Component<any, void> {
type="text"
label={ t('user.common.email') }
placeholder="name@domain.com"
validate={ [Validators.maxLength(100), Validators.emailAddress] }
validate={ [Validators.emailAddress, Validators.maxLength100] }
/>
<Field
......
......@@ -6,6 +6,7 @@ export default class Validators {
public static maxLength = (max) => (value) => value && value.length > max ? `Must be ${max} characters or less` : undefined;
public static maxLength20 = Validators.maxLength(20);
public static maxLength100 = Validators.maxLength(100);
public static emailAddress = (value) => !value || value.match(/^[\w\d\-\+\._]+@[\w\d\-_]+(\.[\w\d\-_]+)*$/g) ? undefined : 'Invalid email address';
public static phoneNumber = (value) => !value || value.match(/^\+[\d\-\. ]+( ext\. \d+)?$/gi) ? undefined : 'Invalid number format: only digits and + . - allowed';
......
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