-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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>} |
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
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;
});
``
The button has been added according to instructions.