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

feat(coinmarket): possibility to proceed with unverified address #14320

Merged
merged 1 commit into from
Sep 27, 2024

Conversation

adderpositive
Copy link
Contributor

@adderpositive adderpositive commented Sep 12, 2024

Issue

When a user gets to the second step in the Buy flow where they select a specific address to receive crypto and the Trezor is disconnected, Suite only allows to Show an unverified address and copy it so the user is stuck.

Design before

obrazek

Solution

Instead of “Show unverified address” in this dialog show “Proceed with unverified address” button, close the dialog, and allow a user to proceed to the partner’s checkout.

Design after

obrazek
obrazek

Related

Resolve #14310

@adderpositive adderpositive added feature Product related issue visible for end user +Invity Related to Invity project labels Sep 12, 2024
@adderpositive adderpositive self-assigned this Sep 12, 2024
packages/suite-data/files/translations/en.json Outdated Show resolved Hide resolved
Comment on lines 258 to 260
!device?.connected
? 'TR_COINMARKET_CONFIRM_ADDRESS'
: 'TR_CONFIRM_ON_TREZOR'
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: might be easier to read without the negation:

device?.connected
    ? 'TR_CONFIRM_ON_TREZOR'
    : 'TR_COINMARKET_CONFIRM_ADDRESS'

@Hermez-cz
Copy link

Change the modal component to the warning one please: https://www.figma.com/design/dYIRTk1qVcKsrJDqOzZ7SG/Modals?node-id=4037-2006&t=6JHZmmhTkl2jrwnV-1

Agreed with the UX designer that the yellow warning state should use only together with the icon as seen in the design.

Comment on lines +135 to +142
// close modals and reset addressVerified on device connection change
useEffect(() => {
dispatch({
type: COINMARKET_BUY.VERIFY_ADDRESS,
addressVerified: undefined,
});
dispatch(modalActions.onCancel());
}, [device?.connected, dispatch]);

Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps this should be moved inside the modal. It is only related to ProceedUnverifiedAddressModal, isn't it?

If you use ConfirmUnverifiedModal, the useEffect is already there.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is related. But it is not possible to clear the addressVerified, if the modal is not opened.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok I thought addressVerified was only set inside the modal.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is only set in the modal. But It is also necessary to set the value as undefined if the modal is not active and the connection of Trezor will change.

@adderpositive
Copy link
Contributor Author

adderpositive commented Sep 18, 2024

I have created a new component ConfirmUnverifiedModalContainer where I moved all logic of unverified modals. It handles receive, xpub, and proceed modals. What do you think about that?

@tomasklim
Copy link
Member

Remembered wallet, Confirm address is spinning

Screen.Recording.2024-09-24.at.15.06.10.mov

@adderpositive
Copy link
Contributor Author

Remembered wallet, Confirm address is spinning
Screen.Recording.2024-09-24.at.15.06.10.mov

it is happening when you are not connected

Comment on lines 72 to 91
<H3>
<Translation id={deviceStatus} values={{ deviceLabel: device.label }} />
</H3>
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you use the heading prop?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The prop heading will add the title to the modal's header. And it doesn't look good in order header -> icon -> paragraph.

Copy link
Contributor

Choose a reason for hiding this comment

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

What does @adamhavel think?

Copy link
Contributor

Choose a reason for hiding this comment

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

Certainly an improvement, although I'd prefer to see the shared logic in ConfirmUnverifiedModal and have two or three wrappers with specifics, kind of like ConfirmUnverifiedAddress worked. This looks like three components in one with little code overlap between them. The effect and enablePassphraseAndContinue could be in ConfirmUnverifiedModal , unless I am missing something.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

@komret
Copy link
Contributor

komret commented Sep 27, 2024

/rebase

Copy link

@tomasklim tomasklim merged commit d77a28c into develop Sep 27, 2024
23 checks passed
@tomasklim tomasklim deleted the feat/add-unverified-modal branch September 27, 2024 11:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Product related issue visible for end user +Invity Related to Invity project
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Coinmarket - Allow buy without connected Trezor device
4 participants