BlockPress now displays Steem Post Comments...
New features
Display of nested comments beneath a steem post
BlockPress now also displays the comments when viewing a post. Obviously for BlockPress to become a fully functional blog, this feature is pretty crucial. I did run into some difficulty at first due to the steem-js api only returning top level comments.
I solved this using recursion. For each comment I check its meta data for children. If it has responses its value for children will be higher than 0.
This also introduced another issue. When the API returns an array of comments, where do I insert them? Since I make a number of asynchronous calls, I do not know in which order the responses will arrive. Luckily each comment also has the permlink id of both itself and its parent. Thus, I made sure I identified the div where responses should go with the id of the parent.
Added comment styling to all existing themes
Once the comment loading was working, I made a little effort to add basic styling to each of the four themes. I expect @dana-varahi will refine these further, but I thought making it so each thread was visible as a thread was a good start.
In addition to the conversation between myself, @funkit and
@radagast above, you can see some variations in the following examples:
with @malamalik and
@akintunde.
with @healingherb and
@crypticat.
with @steemitstats and
@helo.
Commits
Relevant commits, most recent first:
Issue #14 is now closed.
Edit
These changes can now be seen on the blockpress.me main site, just click on 'News' and select an article.
You can also visit dana.blockpress.me or anton.blokpress.me, select Blog and choose a post. In this way you can see the new feature in action with three different styles.
Posted on Utopian.io - Rewarding Open Source Contributors
Leave BlockPress now displays Steem Post Comments... to:
Read more #utopian-io posts
Best Posts From Anton Channing
We have not curated any of antonchanning's posts yet. But you can encourage our curation team to review posts by visiting them regularly and by referring other readers. Because we give priority to frequently read content.
More Posts From Anton Channing
- Iron Maiden Limited Edition CD - Number 06660
- Learning Finnish: WordDive
- My feelings on Brexit...
- Roslin Tree Stump Troll
- Where have we been?
- Random Cat BlockPress module creation tutorial...
- MicroSoft bought Github: What now for open source?
- Antonchanning ZAP - 20180530t121509458z
- BlockPress: Browse Steem Content on an IPFS site...
- A BlockPress Use Case: Github Pages