This repository has been archived by the owner on Dec 17, 2021. It is now read-only.
generated from moonshotcollective/scaffold-eth
-
Notifications
You must be signed in to change notification settings - Fork 10
Change network detection to Web3Context #98
Open
damianmarti
wants to merge
7
commits into
staging
Choose a base branch
from
wrong-network-alert-on-web3-context
base: staging
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
77311ee
Change network detection to Web3Context
damianmarti 3a98910
Add AlertDialog for wrong network message and fix chainChanged callback
damianmarti c8928a4
Merge staging
damianmarti 3fa2d45
Fix rightNetwork undefined
damianmarti 6db2996
Fix init profiles before DRecruitV1 contract loaded
damianmarti 5eca094
Merge staging
damianmarti 263659a
Merge staging
damianmarti File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
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.
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 use the Chakra alert dialog component instead: you can incorporate this here: https://github.com/moonshotcollective/drecruit/blob/staging/packages/react-app/pages/index.js#L48
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.
@QEDK I'm changing this to use the AlertDialog, but I think that it's not want we want. The AlertDialog is a modal, blocking the access to the site. We want just tell the user that the network selected is wrong but allow the user to see the site and the profiles. Please, let me know what you think.
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.
@damianmarti This is intentional, but if you think it should be closable, it is trivial to implement it using
<AlertDialogCloseButton />
however, it should be a blocking option which means that the user has to interact with the modal to make it close (so no implementation to automatically close should be added).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.
@QEDK I understand from my chats with @Cali93 that we want that the site can be viewed even if the user is not in the right network. If we want this, I think that we shouldn't use a modal alert dialog for this. I think we should use just a Chakra alert.
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.
@damianmarti Once the alert dialog is dismissed, the UI will be accessible again (using local provider). Essentially for someone who does not want to switch networks the flow is same except there's no annoying alert left over, if they attempt to connect to the wrong network again, the alert dialog triggers again, so it's consistent and there's no UI remnant, that's the intent here. To clarify, I have no issue with adding a close button to the alert dialog, so that's good with me :)
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.
Ok! Thanks!
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.
@QEDK I made this change and fixed the chainChanged callback (the network provider was not changed before). I tested it changing from the right network to a wrong one, back and forth, and it seem to be working fine now. The action "Request Contact Information" is shown or hidden when you go from the right network to a wrong one. Please review it and let me know if something is wrong.