diff --git a/client/src/components/data.js b/client/src/components/data.js new file mode 100644 index 000000000..c00380228 --- /dev/null +++ b/client/src/components/data.js @@ -0,0 +1,55 @@ +// Array filled with default inputs. +export const simpleInputs = [ + { + label: 'Project Name', + name: 'name', + type: 'text', + placeholder: 'Enter project name', + }, + { + label: 'Project Description', + name: 'description', + type: 'textarea', + placeholder: 'Enter project description', + }, + { + label: 'Location', + name: 'location', + type: 'text', + placeholder: 'Enter location for meeting', + value: /https:\/\/[\w-]*\.?zoom.us\/(j|my)\/[\d\w?=-]+/, + errorMessage: 'Please enter a valid Zoom URL', + addressValue: '', + addressError: 'Invalid address', + }, + { + label: 'GitHub Identifier', + name: 'githubIdentifier', + type: 'text', + placeholder: 'Enter GitHub identifier', + }, + { + label: 'GitHub URL', + name: 'githubUrl', + type: 'text', + placeholder: 'htttps://github.com/', + }, + { + label: 'Slack Channel Link', + name: 'slackUrl', + type: 'text', + placeholder: 'htttps://slack.com/', + }, + { + label: 'Google Drive URL', + name: 'googleDriveUrl', + type: 'text', + placeholder: 'htttps://drive.google.com/', + }, + { + label: 'HFLA Website URL', + name: 'hflaWebsiteUrl', + type: 'text', + placeholder: 'htttps://hackforla.org/projects/', + }, +]; \ No newline at end of file diff --git a/client/src/components/manageProjects/addProject.js b/client/src/components/manageProjects/addProject.js index ba6d9052a..ddec883be 100644 --- a/client/src/components/manageProjects/addProject.js +++ b/client/src/components/manageProjects/addProject.js @@ -1,63 +1,8 @@ import React from 'react'; import ProjectForm from '../ProjectForm'; +import { simpleInputs } from '../data'; function addProject() { - // Array filled with default inputs. - const simpleInputs = [ - { - label: 'Project Name', - name: 'name', - type: 'text', - placeholder: 'Enter project name', - }, - { - label: 'Project Description', - name: 'description', - type: 'textarea', - placeholder: 'Enter project description', - }, - { - label: 'Location', - name: 'location', - type: 'text', - placeholder: 'Enter location for meeting', - value: /https:\/\/[\w-]*\.?zoom.us\/(j|my)\/[\d\w?=-]+/, - errorMessage: 'Please enter a valid Zoom URL', - addressValue: '', - addressError: 'Invalid address', - }, - { - label: 'GitHub Identifier', - name: 'githubIdentifier', - type: 'text', - placeholder: 'Enter GitHub identifier', - }, - { - label: 'GitHub URL', - name: 'githubUrl', - type: 'text', - placeholder: 'htttps://github.com/', - }, - { - label: 'Slack Channel Link', - name: 'slackUrl', - type: 'text', - placeholder: 'htttps://slack.com/', - }, - { - label: 'Google Drive URL', - name: 'googleDriveUrl', - type: 'text', - placeholder: 'htttps://drive.google.com/', - }, - { - label: 'HFLA Website URL', - name: 'hflaWebsiteUrl', - type: 'text', - placeholder: 'htttps://hackforla.org/projects/', - }, - ]; - return (