Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intel bulletins filter #282

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Giriraj-Roy
Copy link

The button has been added according to instructions.

Copy link
Member

@petrvecera petrvecera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, we just need few finishing touches.

And please don't forget to format your code. You can run yarn fix to do so:)

<Card
title={`Intel Bulletins ${type} - ${race} `}
bodyStyle={bodyStyle}
extra = {<button onClick={() => setToggle(!toggle)}> {!toggle ? <span>Display Top 20</span> : <span>Display All Results</span> }</button>}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please try to use https://ant.design/components/switch/ this component, it will look better :) By default is should be enabled and say "Display Top 20"


// Here are all the bulletin data
// console.log(bulletinData)

const sliced = Object.fromEntries(
Object.entries(bulletinData).slice(0, 20)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good but first we need to sort the data. It's unsorted. Please take a look how the data object look slike and sort it based on the values.

I think something like this could work :

sort((a, b) => {
    if (a.value < b.value) {
      return -1;
    }
    if (a.value > b.value) {
      return 1;
    }
    return 0;
  });
  ``

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants