committed by
Mrugesh Mohapatra
parent
61cd404c41
commit
644f34d2ad
@@ -2,10 +2,10 @@ import React, { PureComponent } from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
|
||||
import {
|
||||
Form,
|
||||
isValidURL,
|
||||
makeRequired,
|
||||
createFormValidator
|
||||
Form
|
||||
// isValidURL,
|
||||
// makeRequired,
|
||||
// createFormValidator
|
||||
} from '../../../components/formHelpers';
|
||||
|
||||
const propTypes = {
|
||||
@@ -16,14 +16,14 @@ const propTypes = {
|
||||
const frontEndFields = ['solution'];
|
||||
const backEndFields = ['solution', 'githubLink'];
|
||||
|
||||
const fieldValidators = {
|
||||
solution: makeRequired(isValidURL)
|
||||
};
|
||||
// const fieldValidators = {
|
||||
// solution: makeRequired(isValidURL)
|
||||
// };
|
||||
|
||||
const backEndFieldValidators = {
|
||||
...fieldValidators,
|
||||
githubLink: makeRequired(isValidURL)
|
||||
};
|
||||
// const backEndFieldValidators = {
|
||||
// ...fieldValidators,
|
||||
// githubLink: makeRequired(isValidURL)
|
||||
// };
|
||||
|
||||
const options = {
|
||||
types: {
|
||||
@@ -50,9 +50,9 @@ export class ProjectForm extends PureComponent {
|
||||
id={isFrontEnd ? 'front-end-form' : 'back-end-form'}
|
||||
options={options}
|
||||
submit={this.handleSubmit}
|
||||
validate={createFormValidator(
|
||||
isFrontEnd ? fieldValidators : backEndFieldValidators
|
||||
)}
|
||||
// validate={createFormValidator(
|
||||
// isFrontEnd ? fieldValidators : backEndFieldValidators
|
||||
// )}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
Reference in New Issue
Block a user