diff --git a/src/components/profileform.js b/src/components/profileform.js index dd350ef3..84ef806d 100644 --- a/src/components/profileform.js +++ b/src/components/profileform.js @@ -1,5 +1,5 @@ import Profiletitle from "./profiletitle.js" -import {useState} from "react"; +import {useState} from "react"; import { TextField } from '@mui/material'; import { Grid } from '@mui/material'; import {InputAdornment} from '@mui/material'; @@ -99,7 +99,7 @@ const compsciclasses = [ }); const Container = styled.div` - background-color: #EEEEEE; + background-color: #EEEEEE; height: auto; color: #333333; padding: 30px 0 10px 0; @@ -108,7 +108,7 @@ const Container = styled.div` font-family: 'Poppins', sans-serif; font-size: 40px; } - + /* margin-bottom: 60px; */ ` const defaultValues = { @@ -117,16 +117,17 @@ const defaultValues = { year: "", pronouns:"", instagram: "", - reddit: "", + reddit: "", discord:"", - courses: [], - interests: [], + courses: [], + interests: [], intro:"", }; const Form = () => { const [formValues, setFormValues] = useState(defaultValues); - const [buttonText, setButtonText] = useState("Upload"); + const [buttonText, setButtonText] = useState("Upload"); + const [profileImage, setProfileImage] = useState(null) // const [courseText, setCourseText] = useState([compsciclasses[1]]); const handleInputChange = (e) => { const { name, value } = e.target; @@ -136,16 +137,17 @@ const Form = () => { }); }; - const handleSliderChange = (name) => (e, value) => { - setFormValues({ - ...formValues, - [name]: value, - }); + const handleImageChange = e => { + if(e.target.files[0]) { + setProfileImage(e.target.files[0]) + setButtonText("Uploaded") + } + }; const handleSubmit = (event) => { event.preventDefault(); console.log(formValues); - + console.log(profileImage) //update database updateUser(formValues); }; @@ -153,7 +155,7 @@ const Form = () => {
- +

{ - +

Add a profile picture

-

How should people contact you?

@@ -305,7 +307,7 @@ const Form = () => { />
- +

Select your courses

{ name="courses" label=" Courses" type="text" - + onChange={(event, value) => { let coursesList = []; value.forEach((course) => { @@ -328,14 +330,14 @@ const Form = () => { }); } } //** on every input change hitting my api** - + options={compsciclasses} getOptionLabel={(option) => option.label} InputLabelProps={ { required: true }} renderInput={(params) => ( @@ -351,7 +353,7 @@ const Form = () => { name="interests" label="interests" type="text" - + onChange={(event, value) => { let interestList = []; value.forEach((interests) => { @@ -364,13 +366,13 @@ const Form = () => { }); } } //** on every input change hitting my api** - + options={interests} getOptionLabel={(option) => option.label} InputLabelProps={ { required: true }} renderInput={(params) => ( @@ -396,12 +398,12 @@ const Form = () => {

- + @@ -409,7 +411,7 @@ const Form = () => {
- + ); }; export default Form;