Open
Conversation
petrvecera
requested changes
Oct 17, 2022
Member
petrvecera
left a comment
There was a problem hiding this comment.
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>} |
Member
There was a problem hiding this comment.
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) |
Member
There was a problem hiding this comment.
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;
});
``
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The button has been added according to instructions.