Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
55 changes: 55 additions & 0 deletions client/src/components/data.js
Original file line number Diff line number Diff line change
@@ -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/',
},
];
57 changes: 1 addition & 56 deletions client/src/components/manageProjects/addProject.js
Original file line number Diff line number Diff line change
@@ -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 (
<div>
<ProjectForm
Expand Down
56 changes: 1 addition & 55 deletions client/src/components/manageProjects/editProject.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import EditMeetingTimes from './editMeetingTimes';
import CreateNewEvent from './createNewEvent';
import readableEvent from './utilities/readableEvent';
import ProjectForm from '../ProjectForm';
import { simpleInputs } from '../data';

import { ReactComponent as EditIcon } from '../../svg/Icon_Edit.svg';
import { ReactComponent as PlusIcon } from '../../svg/PlusIcon.svg';
Expand Down Expand Up @@ -54,61 +55,6 @@ const EditProject = ({
}
}, [projectToEdit, regularEvents, setRegularEventsState]);

// Form inputs.
const simpleInputs = [
{
label: 'Project Name',
name: 'name',
type: 'text',
value: projectToEdit.name,
},
{
label: 'Project Description',
name: 'description',
type: 'textarea',
value: projectToEdit.description,
},
{
label: 'Location',
name: 'location',
type: 'text',
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',
value: projectToEdit.githubUrl,
},
{
label: 'Slack Channel Link',
name: 'slackUrl',
type: 'text',
value: projectToEdit.slackUrl,
},
{
label: 'Google Drive URL',
name: 'googleDriveUrl',
type: 'text',
value: projectToEdit.googleDriveUrl,
},
{
label: 'HFLA Website URL',
name: 'hflaWebsiteUrl',
type: 'text',
value: projectToEdit.hflaWebsiteUrl,
},
];

// Get project recurring events when component loads
useEffect(() => {
if (recurringEvents) {
Expand Down