UlogsV2 Development Tasks Part IIsteemCreated with Sketch.

in #utopian-io6 years ago (edited)

Repository: UlogsV2

These are the rest of the tasks I picked up from @surpassinggoogle for Ulogs, and they were a bit harder. The pull request is here, and the task request is once again here.

Edit: I'm including this PR as well, with test logging removal and request loading icon addition, since it's the same task.

Adding Videos to the Banner (Task 4)

This was easier than expected though, because react has a massive base of tools to use. I used react-player (but only imported the YouTube player, since they were all from there) to embed videos into the banner. The videos are a bit sketchy looking, due to the resolution, but their appearance can easily be changed with CSS. I put them in at 100% width, so that there wouldn't be white space hanging around in the banner, and don't think it looks bad at all.

Create a Ulogs-Subtags Page (Task 6)

For this, I was to create a page for ulogs that's similar to steemit's tags page. It wasn't too hard, but was the first time I really built a react component by myself! Yay! The page looks like this:
Screen Shot 2018-12-12 at 4.15.16 PM.png

The component wasn't really the issue to building this page, as much as the steem API was. Looking at steem's page, they use the deprecated getState('/tags')

, which isn't something to be using when it's been deprecated in favor of something else. So, I wrote a new API helper in ulogs to get the trending tags, using the tags_api, and return them to the ulog-subtags page.

Screen Shot 2018-12-12 at 4.15.50 PM.png

The start value is weird, as it's the first tag to return in the list of trending tags, so I just went with ulogs as it's the most trending of the ulog subtags. The limit is maxed at 1000, so that's the default value (not an expensive call). Then I return to the ulog-subtags component, and filter out all the non-ulogs tags.

Screen Shot 2018-12-12 at 4.15.39 PM.png

This logic could probably be rewritten a little bit (removing the logs after this post, didn't notice I left so many in there) for clarity and speed, but it's been pared down from a much larger function that was the first working one, down to this. Since there's a 1000 tag limit on the API call, it loops around a few times, getting more tags and adding them to the final array. Within 10 calls, you get the tags seen in the previous picture, and the next ulog-subtag shows up in the 39th call, so I left it at 10 since that isn't exactly trending, and it takes a bit for that many to load. After that, it returns the tags array to render them in the table.

That's just about it, if there's anything you notice, comment below or on Github. Cheers!

Vote For Me as Your Witness

Cheers, thanks for reading! If you like my tools and content and would like to see more, Vote for me as witness or proxy your votes and I'll pick the best witnesses for you!

My Projects

Pywit- A witness tool-kit built in Python on top of Holger80's Beempy.

Sort:  
  • Congrats on your first react component.
  • There is a lot of console.log entries in the renderTags function, don't forget to remove them next time.
  • No comments in the code this time.
  • The repo link should have https:// for it to be clickable.
  • Perhaps you meant "something else"?

which isn't something to be using when it's been deprecated in favor of someone else.

Your contribution has been evaluated according to Utopian policies and guidelines, as well as a predefined set of questions pertaining to the category.

To view those questions and the relevant answers related to your post, click here.


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

Thanks! The edit pull request I added to it does remove the console.logs, and definitely meant something else. Documented the function I added to apiHelpers, but not the new component yeah. I'll fix the link.

Posted using Partiko Android

Thank you for your review, @helo! Keep up the good work!

Hi @petertag!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your post is eligible for our upvote, thanks to our collaboration with @utopian-io!
Feel free to join our @steem-ua Discord server

Hey, @petertag!

Thanks for contributing on Utopian.
We’re already looking forward to your next contribution!

Get higher incentives and support Utopian.io!
Simply set @utopian.pay as a 5% (or higher) payout beneficiary on your contribution post (via SteemPlus or Steeditor).

Want to chat? Join us on Discord https://discord.gg/h52nFrV.

Vote for Utopian Witness!

Hi, @petertag!

You just got a 0.57% upvote from SteemPlus!
To get higher upvotes, earn more SteemPlus Points (SPP). On your Steemit wallet, check your SPP balance and click on "How to earn SPP?" to find out all the ways to earn.
If you're not using SteemPlus yet, please check our last posts in here to see the many ways in which SteemPlus can improve your Steem experience on Steemit and Busy.

Coin Marketplace

STEEM 0.16
TRX 0.15
JST 0.028
BTC 56586.95
ETH 2389.49
USDT 1.00
SBD 2.34