-
Notifications
You must be signed in to change notification settings - Fork 29
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
Decouple ribbon from comparison table revisions #1844
Conversation
48a32ea
to
80c64c4
Compare
|
||
useEffect(() => { | ||
setOrder(pastOrder => performOrderedUpdate(pastOrder, revisions, reorderId)) | ||
}, [revisions]) |
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.
@sroy3 I copied the pattern that we had elsewhere. Does this work for you?
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.
If we don't do that, it'll keep re-ordering with the comparison table? If so, that's great. If not, then I don't see why we need it.
|
||
useEffect(() => { | ||
setOrder(pastOrder => performOrderedUpdate(pastOrder, revisions, reorderId)) | ||
}, [revisions]) |
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.
If we don't do that, it'll keep re-ordering with the comparison table? If so, that's great. If not, then I don't see why we need it.
@@ -50,7 +59,7 @@ export const Ribbon: React.FC<RibbonProps> = ({ revisions }) => { | |||
appearance="secondary" | |||
/> | |||
</li> | |||
{revisions.map(revision => ( | |||
{reorderObjectList(order, revisions, reorderId).map(revision => ( |
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 should have already been done by the useEffect
above.
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.
Do I need to remove this?
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.
I didn't think that performOrderedUpdate
mutated the original array?
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.
Sorry, I thought it was the same function twice. It's fine.
Code Climate has analyzed commit 7a33da1 and detected 0 issues on this pull request. The test coverage on the diff in this pull request is 100.0% (85% is the threshold). This pull request will bring the total coverage in the repository to 96.9% (0.0% change). View more on Code Climate. |
This PR fixes two bugs:
Demo
Screen.Recording.2022-06-07.at.10.29.03.am.mov