Agoric / ui-kit

Components and tools for building graphical UIs
https://ui-kit-dwm.pages.dev/
Apache License 2.0
3 stars 3 forks source link

feat: provision wallet notice dialog #99

Closed samsiegart closed 2 months ago

samsiegart commented 3 months ago

fixes https://github.com/Agoric/ui-kit/issues/78

Adds a function checkSmartWalletProvisionAndMakeOffer which will automatically show the provision wallet notice before attempting to sign the offer.

Builds upon https://github.com/Agoric/ui-kit/pull/98 to provide the "Deposit IST" button with leap elements.

Testing

Tested with dapp-offer-up in https://github.com/Agoric/dapp-offer-up/commit/f0c2f731f9cfb0b3d47e1fb4f956ef95974cbfcd (using yarn link @agoric/react-components). Simply replaced makeOffer with checkSmartWalletProvisionAndMakeOffer and now it shows the dialog before signing the transaction.

Screenshot

image

otoole-brendan commented 3 months ago

@samsiegart what do you mean by 'shows the dialog before signing the transaction'? Do you mean the dialog will appear to the user when they land on the dapp before they attempt the wallet spend action i.e. 'Create vault'? or do you mean it appears right after they hit 'create vault' but before txn is signed?

samsiegart commented 3 months ago

@otoole-brendan When you click the "make offer" button the dialog will pop up if there's no smart wallet, otherwise it just goes straight to keplr.

cloudflare-pages[bot] commented 2 months ago

Deploying ui-kit with  Cloudflare Pages  Cloudflare Pages

Latest commit: 2adac06
Status: ✅  Deploy successful!
Preview URL: https://dd62859a.ui-kit-dwm.pages.dev
Branch Preview URL: https://provision-dialog-2.ui-kit-dwm.pages.dev

View logs

samsiegart commented 2 months ago

@ivanlei I know you mentioned before checkSmartWalletProvisionAndMakeOffer isn't a great name, agreed. I wanted to ask before merging, what's a better name? makeOfferWithProvision ? Maybe just makeOffer and make the other function makeOfferWithoutSmarWalletCheck?

ivanlei commented 2 months ago

Maybe just makeOffer and make the other function makeOfferWithoutSmarWalletCheck?

That's my vote.

samsiegart commented 2 months ago

Made the provision dialog the default makeOffer, and renamed the previous makeOffer to makeOfferWithoutModal