Skip to content
This repository has been archived by the owner on Mar 28, 2023. It is now read-only.

add reminder to connect wallet in deposit flow #326

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/components/deposit/Start.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,12 @@ const Start = ({
Step 1/5
</div>
<div className="title">
{ error ? 'Error getting available lot sizes' : 'Select Lot Size' }
{ typeof account === 'undefined'
? 'Connect Wallet to Continue'
: (error
? 'Error getting available lot sizes'
: 'Select Lot Size')
}
</div>
<hr />
<Description error={error}>
Expand Down
2 changes: 1 addition & 1 deletion src/components/redemption/Start.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class Start extends Component {
Step 1/6
</div>
<div className="title">
Redeem bond
Redeem Bond
</div>
<hr />
<div className="description">
Expand Down
4 changes: 2 additions & 2 deletions src/wrappers/loadable.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function LoadableBase({ children, restoreDepositState, restoreRedemptionState, r
if(!depositStateRestored) {
return <div className="pay">
<div className="page-top">
<p>Loading...</p>
<p>Connect Wallet to Continue</p>
Copy link
Contributor

Choose a reason for hiding this comment

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

Couldn't the page be loading with a connected wallet and still render this? Feels like this should toggle based on web3Active or something else from useWeb3React, unless I'm mistaken.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I thought the same thing at first, but I could not find a state where this message appeared that was not awaiting wallet connection. For instance: https://dapp.test.tbtc.network/deposit/0xCd0fc3dCb7b47aCbC9bfD5230E32be69d89be7dd/redemption/congratulations
https://dapp.test.tbtc.network/deposit/0x2Df8EFf961816809cc3a0CF5b9C520D6eE49ae04/redemption/signing

but I can figure out a web3Active toggle if you'd prefer 👍

Copy link
Contributor

Choose a reason for hiding this comment

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

Let me pass this on to @ironng who has a more comprehensive test setup locally for now, and let's see where we end up.

Copy link
Contributor

Choose a reason for hiding this comment

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

I gave this a test run locally. @Shadowfiend is correct, there is a state when the wallet is already connected but we're still trying to figure out the deposit state before loading the view - having the message be "Loading" instead of "Connect Wallet" would be more appropriate. Let's add a condition to check if web3 is active to decide which message.

</div>
<div className="page-body">
</div>
Expand All @@ -53,4 +53,4 @@ const mapDispatchToProps = (dispatch) => {

const Loadable = connect(null, mapDispatchToProps)(LoadableBase)

export default Loadable
export default Loadable