Skip to content

Commit 35600d6

Browse files
committed
added indentation
1 parent a04a5f8 commit 35600d6

File tree

1 file changed

+74
-54
lines changed

1 file changed

+74
-54
lines changed

src/components/Rezume/Rezume.js

Lines changed: 74 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -7,82 +7,102 @@ const Rezume = ({ Resume }) => {
77
const { Email, Website, Phone } = Resume.Contact;
88
const NameArray = Name.split(" ");
99
//function for download as png
10-
const downloadAsPNG =()=>{
11-
const rezumeContainer = document.getElementById('rezume');
12-
html2canvas(rezumeContainer).then(function(canvas) {
10+
const downloadAsPNG = () => {
11+
const rezumeContainer = document.getElementById("rezume");
12+
html2canvas(rezumeContainer).then(function (canvas) {
1313
var link = document.createElement("a");
1414
document.body.appendChild(link);
1515
link.download = "rezume.png";
1616
link.href = canvas.toDataURL("image/png");
17-
link.target = '_blank';
17+
link.target = "_blank";
1818
link.click();
19-
})
20-
}
19+
});
20+
};
2121
//function for download as jpeg
22-
const downloadAsJpeg =()=>{
23-
const rezumeContainer = document.getElementById('rezume');
24-
html2canvas(rezumeContainer).then(function(canvas) {
22+
const downloadAsJpeg = () => {
23+
const rezumeContainer = document.getElementById("rezume");
24+
html2canvas(rezumeContainer).then(function (canvas) {
2525
var link = document.createElement("a");
2626
document.body.appendChild(link);
2727
link.download = "rezume.jpeg";
2828
link.href = canvas.toDataURL("image/jpeg");
29-
link.target = '_blank';
29+
link.target = "_blank";
3030
link.click();
31-
})
32-
}
31+
});
32+
};
3333
// function for download as pdf
34-
const downloadAsPDF = ()=>{
35-
const rezumeContainer = document.getElementById('rezume');
34+
const downloadAsPDF = () => {
35+
const rezumeContainer = document.getElementById("rezume");
3636
var w = rezumeContainer.offsetWidth;
3737
var h = rezumeContainer.offsetHeight;
3838
html2canvas(rezumeContainer).then((canvas) => {
39-
const imgData = canvas.toDataURL("image/jpeg",1);
40-
const pdf = new jsPDF('L','pt',[w,h]);
39+
const imgData = canvas.toDataURL("image/jpeg", 1);
40+
const pdf = new jsPDF("L", "pt", [w, h]);
4141
pdf.addImage(imgData, "JPEG", 0, 0);
4242
pdf.save("rezume.pdf");
4343
});
44-
}
44+
};
4545
return (
4646
<>
47-
<div className="rezume-rezume" id="rezume">
48-
<div className="rezume-rezume-contact">
49-
<p>
50-
Email:{" "}
51-
<strong>
52-
<a href={"mailto:" + Email}>{Email}</a>
53-
</strong>
54-
</p>
55-
<p>
56-
Website:{" "}
57-
<strong>
58-
<a
59-
href={"http://" + Website}
60-
target="_blank"
61-
rel="noopener noreferrer"
62-
>
63-
{Website}
64-
</a>
65-
</strong>
66-
</p>
67-
<p>
68-
Phone: <strong>{Phone}</strong>
47+
<div className="rezume-rezume" id="rezume">
48+
<div className="rezume-rezume-contact">
49+
<p>
50+
Email:{" "}
51+
<strong>
52+
<a href={"mailto:" + Email}>{Email}</a>
53+
</strong>
54+
</p>
55+
<p>
56+
Website:{" "}
57+
<strong>
58+
<a
59+
href={"http://" + Website}
60+
target="_blank"
61+
rel="noopener noreferrer">
62+
{Website}
63+
</a>
64+
</strong>
65+
</p>
66+
<p>
67+
Phone: <strong>{Phone}</strong>
68+
</p>
69+
</div>
70+
<h2>
71+
<span>{NameArray.shift()}</span> {NameArray.join(" ")}
72+
</h2>
73+
<p className="location">{Location}</p>
74+
<p className="summary">
75+
<strong className="position">{CurrentPosition}</strong>
76+
{Summary}
6977
</p>
7078
</div>
71-
<h2>
72-
<span>{NameArray.shift()}</span> {NameArray.join(" ")}
73-
</h2>
74-
<p className="location">{Location}</p>
75-
<p className="summary">
76-
<strong className="position">{CurrentPosition}</strong>
77-
{Summary}
78-
</p>
79-
</div>
80-
<div className="py-5 download-btns">
81-
<button className="btn btn-secondary m-1" id="downloadAsPngBtn" onClick={()=>{downloadAsPNG()}}>Download as png</button>
82-
<button className="btn btn-secondary m-1" id="downloadAsJpeg" onClick={()=>{downloadAsJpeg()}}>Download as Jpeg</button>
83-
<button className="btn btn-secondary m-1" id="downloadAsPDF" onClick={()=>{downloadAsPDF()}}>Download as PDF</button>
84-
</div>
85-
</>
79+
<div className="py-5 download-btns">
80+
<button
81+
className="btn btn-secondary m-1"
82+
id="downloadAsPngBtn"
83+
onClick={() => {
84+
downloadAsPNG();
85+
}}>
86+
Download as png
87+
</button>
88+
<button
89+
className="btn btn-secondary m-1"
90+
id="downloadAsJpeg"
91+
onClick={() => {
92+
downloadAsJpeg();
93+
}}>
94+
Download as Jpeg
95+
</button>
96+
<button
97+
className="btn btn-secondary m-1"
98+
id="downloadAsPDF"
99+
onClick={() => {
100+
downloadAsPDF();
101+
}}>
102+
Download as PDF
103+
</button>
104+
</div>
105+
</>
86106
);
87107
};
88108
export default Rezume;

0 commit comments

Comments
 (0)