Skip to content

Commit

Permalink
add profile picture upload feature. drag and drop allowed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Epic-Eric committed Jun 28, 2024
1 parent 72aba20 commit d7fd472
Show file tree
Hide file tree
Showing 4 changed files with 441 additions and 291 deletions.
198 changes: 76 additions & 122 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
"dependencies": {
"@testing-library/user-event": "^13.2.1",
"axios": "^1.7.2",
"dropzone": "^6.0.0-beta.2",
"eslint": "^8.40.0",
"eslint-plugin-react": "^7.32.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-router-dom": "^6.24.0",
"react-scripts": "5.0.1",
"web-vitals": "^2.1.0"
},
Expand Down
7 changes: 6 additions & 1 deletion src/components/personal-info.jsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React, {useState} from "react";
import axios from 'axios';

function PersonalInfo() {
const [userInfo, setUserInfo] = useState({
Expand All @@ -18,7 +19,7 @@ const handleSubmit = async (e) => {
const response = await axios.post("/resume/personal", //update the route after it's implemented in the backend
...userInfo);
console.log(`user info added with ID: ${response.data.id}`);
navigateTo("mainMenu");
//navigateTo("mainMenu");
} catch (error) {
console.error("Error adding user info:", error);
alert("Failed to add user info.");
Expand All @@ -40,6 +41,10 @@ const handleSubmit = async (e) => {

<label for="email">Enter your email address: </label>
<input type="tel" name="number"></input>

<label for="profile-pic">Upload you profile picture here: </label>
<input type="file" name="file" onChange={handleChange}/>

<button type="submit">Save</button>
</form>
);
Expand Down
Loading

0 comments on commit d7fd472

Please sign in to comment.