Skip to content

Commit

Permalink
first draft commit
Browse files Browse the repository at this point in the history
  • Loading branch information
StephenTheDev1001 authored and trillium committed Mar 4, 2024
1 parent 3516046 commit 412d794
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 133 deletions.
43 changes: 21 additions & 22 deletions client/src/components/data.js
Original file line number Diff line number Diff line change
@@ -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',
Expand All @@ -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/',
},
];
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.jsx
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

0 comments on commit 412d794

Please sign in to comment.