Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upload cv #22

Open
wants to merge 5 commits into
base: development-master
Choose a base branch
from
Open
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
16 changes: 16 additions & 0 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 @@ -9,10 +9,12 @@
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.3.2",
"@testing-library/user-event": "^7.1.2",
"ang-drag-drop": "^1.0.1",
"axios": "^0.19.2",
"mdi-material-ui": "^6.16.0",
"react": "^16.13.1",
"react-dom": "^16.13.1",
"react-dropzone-uploader": "^2.11.0",
"react-router": "^5.2.0",
"react-router-dom": "^5.2.0",
"react-scripts": "3.4.1",
Expand Down
2 changes: 1 addition & 1 deletion src/components/profile/UpdateProfile.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ export default function AlumniProfile() {
<Container maxWidth="sm">
<BasicInfo />
<UploadPicture />
<UploadCV />
<GitHubLink />
<LinkedInLink />
<TechnicalRating />
<LanguageRating />
<UploadCV />
<Container maxWidth="sm">
<Button
onClick={() => history.push("/profilealumni")}
Expand Down
67 changes: 55 additions & 12 deletions src/components/profile/UploadCV.jsx
Original file line number Diff line number Diff line change
@@ -1,28 +1,71 @@
import React from "react";
import { Button, Container } from '@material-ui/core';
import CloudUploadIcon from '@material-ui/icons/CloudUpload';
//import { Button, Container } from "@material-ui/core";
//import CloudUploadIcon from "@material-ui/icons/CloudUpload";
import { makeStyles } from "@material-ui/core/styles";
import "react-dropzone-uploader/dist/styles.css";
import Dropzone from "react-dropzone-uploader";

const useStyles = makeStyles((theme) => ({
button: {
margin: theme.spacing(1),
},
}));

const Preview = ({ meta }) => {
const { name, percent, status } = meta;
return (
<span
style={{
alignSelf: "flex-start",
margin: "10px 3%",
fontFamily: "Helvetica",
}}
>
{name}, {Math.round(percent)}%, {status}
</span>
);
};

const handleSubmit = (files, allFiles) => {
console.log(files.map((f) => f.meta));
allFiles.forEach((f) => f.remove());
};

export default function UploadCV() {
const classes = useStyles();

const getUploadCV = () => ({
url: " https://httpbin.org/post",
});

return (
<div>
<Container spacing={1}>
<Button
variant="contained"
color="default"
className={classes.button}
startIcon={<CloudUploadIcon />}
>
Upload CV
</Button>
<Dropzone
getUploadCV={getUploadCV}
onSubmit={handleSubmit}
PreviewComponent={Preview}
inputContent="Drop Files (CV)"
disabled={(files) =>
files.some((f) =>
["preparing", "getting_upload_params", "uploading"].includes(
f.meta.status
)
)
}
/>
{/*

<Container spacing={1}>
<Button
variant="contained"
color="default"
className={classes.button}
startIcon={<CloudUploadIcon />}
>
Upload CV
</Button>
</Container>

*/}
</div>
);
}