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

Export as HTML, JSON, Import JSON, all but better #25

Merged
merged 22 commits into from
May 26, 2024
Merged

Conversation

5e-Cleric
Copy link
Member

This PR fixes some weird coding methods i have been using that need some correcting.

@5e-Cleric 5e-Cleric changed the title Fix mistakes Export as HTML, JSON, Import JSON, all but better Mar 5, 2024
@5e-Cleric 5e-Cleric mentioned this pull request Mar 5, 2024
@5e-Cleric 5e-Cleric added this to the Axe 1.0 milestone Mar 5, 2024
@5e-Cleric 5e-Cleric added the 🔍 R0 - Needs first review 👀 PR ready but has not been reviewed label Mar 6, 2024
@5e-Cleric 5e-Cleric self-assigned this Mar 6, 2024
Copy link
Collaborator

@G-Ambatte G-Ambatte left a comment

Choose a reason for hiding this comment

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

Looks like it's in good shape, the main thing I picked up is that we should consider the use of React's createRef functions to access DOM elements, rather than document.getElementById calls - see documentation here and here.

src/components/builderPage/sheet.css Outdated Show resolved Hide resolved
src/components/sheetSettings.jsx Outdated Show resolved Hide resolved
src/components/sheetSettings.jsx Outdated Show resolved Hide resolved
src/components/builderPage/builderPage.jsx Outdated Show resolved Hide resolved
src/components/sheetSettings.jsx Outdated Show resolved Hide resolved

<button
onClick={() => {
document.getElementById("importJson").click();
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can eliminate the document.getElementById calls by using React refs instead, in this case it would look like this:

image
image
image

Copy link
Member Author

Choose a reason for hiding this comment

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

then grab the file like this?

image

Copy link
Collaborator

Choose a reason for hiding this comment

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

Exactly

@5e-Cleric 5e-Cleric added 🔍 R3 - Reviewed - Awaiting Fixes PR is okayed but needs fixes before merging and removed 🔍 R0 - Needs first review 👀 PR ready but has not been reviewed labels Apr 11, 2024
…N export functionality, and implemented JSON import feature."
…s, including changes to styles, class names, and local storage keys."
@5e-Cleric 5e-Cleric linked an issue May 25, 2024 that may be closed by this pull request
4 tasks
@5e-Cleric
Copy link
Member Author

CSS import for html export is messed up, style filtering doesn't really work right now, find a better way to split styles (comment for myself)

… removing and reorganizing styles, and updating imports and selectors."
@5e-Cleric
Copy link
Member Author

Leaving change to refs to a next PR

@5e-Cleric 5e-Cleric merged commit 4ee0a73 into main May 26, 2024
@5e-Cleric 5e-Cleric deleted the fix-mistakes branch May 26, 2024 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔍 R3 - Reviewed - Awaiting Fixes PR is okayed but needs fixes before merging
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Export as different formats
2 participants