Comments are here! Wo0ot! A huge move forward to getting the Steem front-end done. Not just viewing the comments, but also posting new comments to any post on Steem! Hell ya!
It took a while to figure all out, and I had some head-banging bumps along the way this week, but I finally got it all working :)
Lot's of fixes were done as well during the development.
Any feedback is welcome and appreciated, even criticism ;)
What do you want to see next? What would make you use the site?
Do you want to find content that other people really value, based on topics that interest you? How?
Upvotes don't do it, because so many upvotes come from autovoting, autobots, or curation trails. You don't know if a vote for content is done by a real person, or some automation. The content isn't being evaluated when it's automated.
Plus, you can upvote so many things, which can be unrelated.
Imagine a curation network where people are interacting through community groups to share and value content, and you can really see what they value globally through various communities that people organize and collaborate together to build.
KURE provides a network hub for people to create their own community groups for evaluating content to curate. It will also develop into communities to create posts within.
Create your own communities and have others join to contribute. Make up your own criteria. Manage who can add curation links to your community group. Anyone else can follow your community and engage.
My goal is to make content easier for everyone to find by all of us sharing the content we like trough communities. Others can find communities they are interested in and see what is being curated within that community to also support it with upvotes, resteems and comments.
Maybe you want to share what you value, and get others to see it or support it, but don't want to resteem it, or want more people to see it. On KURE, the community you create and those who are involved in it will popularize content you value and allow others to see it. Another way of thinking about it, is it's kind of like having a custom community feed, based on a community that engages in creating it, rather than just one person.
KURE empowers the Steem community to coordinate their curation efforts through building community networks of their own.
The first thing I need to do was get comments to show on posts. Sounds easy enough. I got the first level of comments to show with some work. But I ran into some trouble with returning Promises that weren't resolved in my recursive fetching of data from Steem.
I was getting a Promise returned for comments that had children in them:
Comments that didn't have children, were returned as objects. The solution was to force a resolve on all Promises from the recursion:
And voila! All comments on a post are now visible!
The full markdown is shown, but I still have to add some stuff, like the rep and the voting and replying to comments, as well as editing the comments themselves.
After I got the viewing of comments done, I could get to adding comments to Steem.
Adding posts is done through a form I made, consisting of a textarea, and a button to post and button to clear the form.
After entering the text, you can then post to the blockchain:
As you wait and can't edit the comment, a spinner is shown until the post is added to the Steem blockchain. Using Steem Connect, the parentAuthor, parentPermlink, author, permlink, '', body, jsonMetadata are constructed and then sent for processing.
When the results come back, I get the comment itself from the blockchain, and dispatch it as results to be grabbed by the app again and shown on the page:
Then what you see is a cleared comment form, and your new comment gets added to the page!
Previously, I had forgotten to add the post link to the image sin the PostSummary view. You could only click the title to open the post. Thanks to a reminder froma comment in my last update, this was suggested to be done. So I did it. Now you can click on the thumbnail image and see.
Another thing I had been putting off as I worked on other stuff, was the tags. Tags weren't even shown on PostDetails :/ I know, pretty crappy to not show those. So they have been added:
It's just a basic loop through map that displays each linked tag:
When I added the moment package to the communities, I wanted a short name format that I customized:
But that was also showing for the PostSummary and PostDetail, which wasn't as nice.
After asking on stackoverflow, I managed to get two different formats to show, and now the posts themselves have the nicer longer date format:
When I had done the upvoting last week, it worked to update the vote count on the page after the vote went through, but the payout count wasn't getting added. I needed to add all the post data, not just the upvote.
I changed the redux store to add the whole post, which I then used to get the needed information, such as vote count and payout value that was changed by the vote count:
Another issue I noticed, was that if you voted on more than one post, the previous post data was being lost. It was reverting to the stored state data from redux prior to the previous upvote being added.
To solve that issue, I had to store each voted post data in the store, which is the image above as well that contains the finalized working version.
The code before that was only storing the current upvoted post data, and losing the previous ones. Now, they all get stored and the updates for voting stay visible.
When I added the different date formats to the Communities vs. the PostDetails and PostSummary, there was a bug where all the times where showing as 'a few seconds ago' for each post being opened.
The error on my part was that I was doing a fromNow() on a date that was already applied to fromNow(). So fromNow() was being applied twice and it just bugged out.
I skipped past liking and rating for communities, and went for the viewing and posting of comments this week. It's an important part to have done. Up next will be posting content in general, not just comments ;). Another challenging week ahead :)
Working on:
If you want to contact me, you can reach me on Discord at https://discord.gg/ApUp4jJ, or email at [email protected]. I'm not really on steem.chat, but I think I get emails if you send me a message.
[email protected]Thank you for your time, attention and support! I appreciate it!
Peace.