Thousand Card Game: Bidding View Added

in #utopian-io7 years ago (edited)

image.png

Image source: pixabay.com

What is this project about?

This contribution is made to
gornanization/1k-table.
If you would like to find more info - I strongly recommend reading
this post first.

PR:

https://github.com/gornanization/1k-table/pull/7

Details:

Recently I added scores view. Today I would like to show you similar view, but with different data: bidding history. It is required for bidding phase.

image.png

Some time ago I presented to you the whole state of the game logic project (1k). It's described i.e. here. I mentioned about the way bidding history is being stored inside the redux state:

Please, focus on lines :260 - :264. You can see there are set of player bids. pass property shows us whether player rejected to bid and is no longer involved in bidding process.

I decided to use the same shape of object in the 1k-table:

image.png

As it's defined in global state, we can access it inside the Bids UI component with no effort. How does the component look like? Quiet simple, I guess:

image.png

If you are not familiar with the Vuejs, you might find this code fragment, let's say, "chaotic"?

We have basically the whole component definition in one file. It includes template, javascript code and styles. This approach is really convenient for small component definitions.

In line :21 I access global store to get bid history. It's done within the bids function defined in computed area of the component. Pure store data is being parsed (using slice, reverse, etc.) in order to prepare data before displaying in. Manipulated bids list is accessible in the template, where we do basically iterate over those entries.

Each table row is displayed through separated bid-row component (:6). If you would like to see more, check pull request!

Later, bidders!

Recent articles:
Thousand Card Game: Scores View Added
Thousand Card Game: Trick Position Animation
Thousand Card Game: Trick Animation



Posted on Utopian.io - Rewarding Open Source Contributors

Sort:  

Thank you for the contribution. It has been approved.

I really enjoy seeing consistent updates to a cool project - thank you for contributing to utopian!

You can contact us on Discord.
[utopian-moderator]

Thanks, I also appreciate your moderation work!

Hey there. I have both your approve and utopian-bot upvote, but the post is still flagged as "Under Review". Not sure how it works internally, but is it consistent with your moderation work-flow?

The API is having some issues after the newest update, you don't need to worry, this post is accepted and will continue to be.

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

Achievements

  • You have less than 500 followers. Just gave you a gift to help you succeed!
  • Seems like you contribute quite often. AMAZING!

Community-Driven Witness!

I am the first and only Steem Community-Driven Witness. Participate on Discord. Lets GROW TOGETHER!

mooncryption-utopian-witness-gif

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

Coin Marketplace

STEEM 0.20
TRX 0.15
JST 0.030
BTC 65637.68
ETH 2661.86
USDT 1.00
SBD 2.81