BlockPress now displays Steem Post Comments...

in #utopian-io6 years ago (edited)

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

Sort:  

Hey @antonchanning I am @utopian-io. I have just upvoted you!

Achievements

  • Seems like you contribute quite often. AMAZING!

Utopian Witness!

Participate on Discord. Lets GROW TOGETHER!

Up-vote this comment to grow my power and help Open Source contributions like this one. Want to chat? Join me on Discord https://discord.gg/Pc8HG9x

Thank you for the contribution. It has been approved.

I'm looking forward to the update of the wiki for the config file.


Need help? Write a ticket on https://support.utopian.io.
Chat with us on Discord.

[utopian-moderator]

I will make sure I write a tutorial about editing the config file, although it should be straight forward enough for anyone familiar with JSON format.

None-the-less, we are also planning to create a tool for auto generating a config file. This is already in the issue tracker, and is scheduled for the first stable release after the initial beta release:

https://github.com/blockpress/blockpress.me/issues/29

I have added the wiki update as an issue: https://github.com/blockpress/blockpress.me/issues/33

I noticed on the wiki I promised to do that update once issue #3 was closed. Well it is closed, so I will write that tutorial this weekend.

Awesome I seriously want to learn how to make a post in Utopia maybe you can help teach me sir

Let me know in steem.chat what you want to do, it really depends on what way you want to contribute to an open source project.

Coin Marketplace

STEEM 0.19
TRX 0.14
JST 0.030
BTC 59876.72
ETH 3191.77
USDT 1.00
SBD 2.43