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 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:

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

with @malamalik and @akintunde.

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

with @healingherb and @crypticat.

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

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

H2
H3
H4
Upload from PC
Video gallery
3 columns
2 columns
1 column
6 Comments