From 5356b13964b56a0d8c3a72eded0067bc9418064a Mon Sep 17 00:00:00 2001 From: Stephen Saldana Date: Mon, 28 Aug 2023 20:03:15 -0700 Subject: [PATCH 1/2] created data.js and copied simpleInputs from addProject.js --- client/src/components/data.js | 56 +++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 client/src/components/data.js diff --git a/client/src/components/data.js b/client/src/components/data.js new file mode 100644 index 000000000..1163d3280 --- /dev/null +++ b/client/src/components/data.js @@ -0,0 +1,56 @@ +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' + }, + // Leaving incase we want to add this back in for updating projects + // { + // 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/' + } + // Leaving incase we want to add this back in for updating projects + // { + // label: 'HFLA Website URL', + // name: 'hflaWebsiteUrl', + // type: 'text', + // placeholder: 'htttps://hackforla.org/projects/', + // }, +] From 471f1f76415535996d06a3a3e47347d3ff51b6f2 Mon Sep 17 00:00:00 2001 From: Stephen Saldana Date: Mon, 28 Aug 2023 20:51:50 -0700 Subject: [PATCH 2/2] first draft commit --- client/src/components/data.js | 43 +++++++------- .../components/manageProjects/addProject.js | 57 +------------------ .../components/manageProjects/editProject.js | 56 +----------------- 3 files changed, 23 insertions(+), 133 deletions(-) diff --git a/client/src/components/data.js b/client/src/components/data.js index 1163d3280..c00380228 100644 --- a/client/src/components/data.js +++ b/client/src/components/data.js @@ -1,15 +1,16 @@ +// Array filled with default inputs. export const simpleInputs = [ { label: 'Project Name', name: 'name', type: 'text', - placeholder: 'Enter project name' + placeholder: 'Enter project name', }, { label: 'Project Description', name: 'description', type: 'textarea', - placeholder: 'Enter project description' + placeholder: 'Enter project description', }, { label: 'Location', @@ -19,38 +20,36 @@ export const simpleInputs = [ value: /https:\/\/[\w-]*\.?zoom.us\/(j|my)\/[\d\w?=-]+/, errorMessage: 'Please enter a valid Zoom URL', addressValue: '', - addressError: 'Invalid address' + addressError: 'Invalid address', + }, + { + label: 'GitHub Identifier', + name: 'githubIdentifier', + type: 'text', + placeholder: 'Enter GitHub identifier', }, - // Leaving incase we want to add this back in for updating projects - // { - // label: 'GitHub Identifier', - // name: 'githubIdentifier', - // type: 'text', - // placeholder: 'Enter GitHub identifier', - // }, { label: 'GitHub URL', name: 'githubUrl', type: 'text', - placeholder: 'htttps://github.com/' + placeholder: 'htttps://github.com/', }, { label: 'Slack Channel Link', name: 'slackUrl', type: 'text', - placeholder: 'htttps://slack.com/' + placeholder: 'htttps://slack.com/', }, { label: 'Google Drive URL', name: 'googleDriveUrl', type: 'text', - placeholder: 'htttps://drive.google.com/' - } - // Leaving incase we want to add this back in for updating projects - // { - // label: 'HFLA Website URL', - // name: 'hflaWebsiteUrl', - // type: 'text', - // placeholder: 'htttps://hackforla.org/projects/', - // }, -] + 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 (
{ if (recurringEvents) {