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

Render block content #10

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Render block content #10

wants to merge 14 commits into from

Conversation

KokkieH
Copy link
Owner

@KokkieH KokkieH commented Feb 21, 2022

Fixes #9

  • Added a block.json file
  • Added separate stylesheets for styling block in editor and on front end
  • Added color settings support to Settings sidebar
  • Added Commit Hash input to Settings sidebar
  • Added save function to display block content on front end
  • Added API call to fetch commit data
  • Render API data in the block and on the front end
  • Added a custom GitHub icon to the block

Next steps:

  • I don't like the same code for the block content being re-used in the edit and save functions. Is it possible to assign the output to a single attribute so we can then just re-use that one attribute?
  • I figured out how to prevent the .editor-styles-wrapper from overriding my custom stylesheet for the block in the editor, but it seems the block colour controls don't have any effect on text added inside the <h3> or <a> elements.
  • I need to figure out how to use the Notice component to display an error notice in the editor if the API call fails due to an invalid commit hash.

But it works, so this is ready to ship.

@tgglv
Copy link
Collaborator

tgglv commented Mar 15, 2022

Thanks, @KokkieH!

The changes look great. The only thing I want to highlight is that we should remove built sources from repo by adding build folder into a .gitignore. Otherwise, everything is great!

@KokkieH
Copy link
Owner Author

KokkieH commented Mar 16, 2022

we should remove built sources from repo by adding build folder into a .gitignore

Thanks for the tip. I think 1db80d6 should do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use GH Commit Block to fetch data from REST API
2 participants