Skip to content

Decouple the swap modal from the swap list#494

Merged
sindresorhus merged 1 commit into
masterfrom
keep-modal-open
Aug 31, 2018
Merged

Decouple the swap modal from the swap list#494
sindresorhus merged 1 commit into
masterfrom
keep-modal-open

Conversation

@sindresorhus
Copy link
Copy Markdown
Contributor

@sindresorhus sindresorhus commented Aug 30, 2018

And instead of accepting a swap object, it now accepts a swap ID.

The swap modal is now controlled by the swap list instead of controlling itself.

This fixes the issue with an open swap modal suddenly disappearing when the swap completes, as mention in #484.

Notice how the swap list is empty, but the modal is still open:

screen shot 2018-08-30 at 23 55 52

And instead of accepting a swap object, it now accepts a swap ID.

It's the swap modal is now a controlled by the swap list instead of controlling itself.
@sindresorhus sindresorhus requested a review from kevva August 30, 2018 16:59
static propTypes = {
swap: PropTypes.object,
swapId: PropTypes.string,
open: PropTypes.bool,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick, but I think boolean props should be prefixed with is or has for clarity.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I agree, but it's coming from

open: PropTypes.bool,
So the change should be done separately and for all uses.

@sindresorhus sindresorhus merged commit 5c5b043 into master Aug 31, 2018
@sindresorhus sindresorhus deleted the keep-modal-open branch August 31, 2018 07:07
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