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

Added download feature #90

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

Neha9849
Copy link

@Neha9849 Neha9849 commented Mar 4, 2022

Issue that this pull request solves

Closes: #86

Proposed changes

I added 3 buttons - Download as png, Download as jpeg and Download as pdf

Types of changes

Put an x in the boxes that apply

  • Bugfix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update (Documentation content changed)
  • Other (please describe):

Checklist

Put an x in the boxes that apply

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Screenshots

Please attach the screenshots of the changes made in case of change in user interface

Other information

Any other information that is important to this pull request

@praveenscience
Copy link
Member

Why do we have so many new dependencies? I was talking about react-component-export-image package. Can you please look into that instead and use only PDF export?

@Neha9849
Copy link
Author

Neha9849 commented Mar 4, 2022

Why do we have so many new dependencies? I was talking about react-component-export-image package. Can you please look into that instead and use only PDF export?

I removed all the extra packages i used and now i am only using jspdf and html2canvas.
Also react-component-export-image has jspdf and html2canvas has dependencies so i think whatever i did is more efficient.

@github-actions github-actions bot added the has conflicts Damnnn these conflicts! :( label Mar 4, 2022
@praveenscience
Copy link
Member

Okay, that makes sense, thanks for clarifying. Let me see if I can fix the conflicts...

Comment on lines 9 to 20
//function for download as png
const downloadAsPNG =()=>{
const rezumeContainer = document.getElementById('rezume');
html2canvas(rezumeContainer).then(function(canvas) {
var link = document.createElement("a");
document.body.appendChild(link);
link.download = "rezume.png";
link.href = canvas.toDataURL("image/png");
link.target = '_blank';
link.click();
})
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For the whole file, please kindly indent the content in 2 space mode.

Copy link
Member

@praveenscience praveenscience left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use the prettier settings? 😁

@praveenscience
Copy link
Member

praveenscience commented Mar 6, 2022

Seems like you have reverted everything?

No wait. Lemme check and try helping out with the conflict resolution...

@praveenscience
Copy link
Member

Hey... Can you try cherry-picking and fixing it?

Comment on lines +10 to +32
const downloadAsPNG = () => {
const rezumeContainer = document.getElementById("rezume");
html2canvas(rezumeContainer).then(function (canvas) {
var link = document.createElement("a");
document.body.appendChild(link);
link.download = "rezume.png";
link.href = canvas.toDataURL("image/png");
link.target = "_blank";
link.click();
});
};
//function for download as jpeg
const downloadAsJpeg = () => {
const rezumeContainer = document.getElementById("rezume");
html2canvas(rezumeContainer).then(function (canvas) {
var link = document.createElement("a");
document.body.appendChild(link);
link.download = "rezume.jpeg";
link.href = canvas.toDataURL("image/jpeg");
link.target = "_blank";
link.click();
});
};
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need these two anyway. We can remove it.

{Summary}
</p>
</div>
<div className="py-5 download-btns">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering if we can keep the download button on the navbar?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This issue has been stale for many days now, any update on the progress would be appreciated @Neha9849

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
has conflicts Damnnn these conflicts! :(
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add download button
3 participants