Skip to content
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

Banxa | UI redesign #1026

Open
wants to merge 274 commits into
base: next
Choose a base branch
from
Open

Banxa | UI redesign #1026

wants to merge 274 commits into from

Conversation

nop33
Copy link
Member

@nop33 nop33 commented Dec 9, 2024

⚠️ DON'T MERGE UNTIL WALLET CONNECT MODALS ARE FIXED

To be used in the LandingScreen
Introduce new modal system with BuyModal (fix Banxa reload issue)
Tried a LOT to use imprative handle to manage ref and closing bottom modal imperatively.
But it was just too complicated and messy. I'll find another way.
Will investigate another way. This works, but we keep some variables in memory
after the modal is closed. Not a big deal, but we can do better.
Still not there yet
Comment on lines +555 to +581
const openWalletConnectSessionProposalModal = useCallback(
() =>
sessionProposalEvent &&
dispatch(
openModal({
name: 'WalletConnectSessionProposalModal',
props: {
approveProposal,
rejectProposal,
proposalEvent: sessionProposalEvent
}
case 'alph_signUnsignedTx': {
const { signerAddress, signerKeyType, unsignedTx } = requestEvent.params.request
.params as SignUnsignedTxParams
})
),
[approveProposal, dispatch, rejectProposal, sessionProposalEvent]
)

const fromAddress = addressIds.find((address) => address === signerAddress)
const onSessionProposal = useCallback(
async (sessionProposalEvent: SessionProposalEvent) => {
console.log('📣 RECEIVED EVENT PROPOSAL TO CONNECT TO A DAPP!')
console.log('👉 ARGS:', sessionProposalEvent)
console.log('⏳ WAITING FOR PROPOSAL APPROVAL OR REJECTION')

if (!fromAddress) {
return respondToWalletConnectWithError(requestEvent, {
message: "Signer address doesn't exist",
code: WALLETCONNECT_ERRORS.SIGNER_ADDRESS_DOESNT_EXIST
})
}
setSessionProposalEvent(sessionProposalEvent)
openWalletConnectSessionProposalModal()
},
[openWalletConnectSessionProposalModal]
)
Copy link
Member Author

Choose a reason for hiding this comment

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

This doesn't work.

      setSessionProposalEvent(sessionProposalEvent)
      openWalletConnectSessionProposalModal()

because in the openWalletConnectSessionProposalModal function, sessionProposalEvent has not yet received a value before it's called.

Copy link
Member Author

Choose a reason for hiding this comment

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

Same problem with openWalletConnectSessionRequestModal.

nop33 added a commit that referenced this pull request Dec 19, 2024
nop33 added a commit that referenced this pull request Dec 19, 2024
nop33 added a commit that referenced this pull request Dec 19, 2024
nop33 added a commit that referenced this pull request Dec 19, 2024
nop33 added a commit that referenced this pull request Dec 19, 2024
nop33 added a commit that referenced this pull request Dec 19, 2024
mvaivre pushed a commit that referenced this pull request Dec 19, 2024
mvaivre pushed a commit that referenced this pull request Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
📱 MW Mobile wallet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants