Commit c213522a authored by ras19's avatar ras19
Browse files

Added option to include single volunteer into project when creating a new one [RS, EW]

parent 290744b3
Pipeline #202186 passed with stage
in 2 minutes and 26 seconds
import { useState } from "react";
import { useHistory } from "react-router-dom"
import useFetch from './useFetch'
const CreateProject = () => {
const [name, setName] = useState("");
......@@ -8,9 +9,12 @@ const CreateProject = () => {
const [tag, setTag] = useState("Other");
const [location, setLocation] = useState("");
const [files, setFiles] = useState("");
const [username, setUsername] = useState("");
const history = useHistory();
const { data: users, error, isPending } = useFetch("/users")
const handleSubmit = e => {
e.preventDefault()
......@@ -56,11 +60,15 @@ const CreateProject = () => {
<select value={tag} onChange={(e) => setTag(e.target.value)}>
<option value="Social">Social</option>
<option value="Education">Education</option>
<option value="Wash">Wash</option>
<option value="Wasimport useFetch from './useFetch'h">Wash</option>
<option value="Environment">Environment</option>
<option value="Health">Health</option>
<option value="Other">Other</option>
</select>
<label>Volunteers assigned to this project</label>
<select value={username} onChange={(e) => setUsername(e.target.value)}>
{users.map(user => <option value={user.username}>{user.username}</option>)}
</select>
<label>Google Drive folder</label>
<textarea placeholder="Copy the link to the Google Drive folder for this project" value={files} onChange={(e) => setFiles(e.target.value)}></textarea>
<button>Add project</button>
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment