Skip to content

Intel bulletins filter#282

Open
Giriraj-Roy wants to merge 2 commits intocohstats:masterfrom
Giriraj-Roy:intelBulletins-filter
Open

Intel bulletins filter#282
Giriraj-Roy wants to merge 2 commits intocohstats:masterfrom
Giriraj-Roy:intelBulletins-filter

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"

// 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

Comments