Anton Channing avatar

BlockPress now displays Steem Post Comments...

antonchanning

Published: 15 Apr 2018 › Updated: 15 Apr 2018BlockPress now displays Steem Post Comments...

BlockPress now displays Steem Post Comments...

Firefox_Screenshot_2018-04-15T11-15-55.846Z.png

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@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@funkit and radagast@radagast above, you can see some variations in the following examples:

Firefox_Screenshot_2018-04-14T19-12-03.998Z.png

with malamalik@malamalik and akintunde@akintunde.

Firefox_Screenshot_2018-04-15T10-41-15.602Z.png

with healingherb@healingherb and crypticat@crypticat.

Firefox_Screenshot_2018-04-15T11-06-49.104Z.png

with steemitstats@steemitstats and helo@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:

Written by

💻 @blockpress and #steemswitch lead developer. 👽 #opintruder special agent. ☠ #dkmu anarcho pirate sorcerer.

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