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

Enable sign in Button override #2387

Merged
merged 3 commits into from
Aug 5, 2024
Merged

Conversation

ataideverton
Copy link
Contributor

@ataideverton ataideverton commented Jul 18, 2024

What's the purpose of this pull request?

During the development of the B2B Self Management feature, we need to customize and add new behaviors to the "My Account" button, making it open a modal instead of going to the /account page. While most of this development will happen in an external library, the ability to override this button is important for us.

This PR enables just that, the ability to completely override the default SignIn / My Account button.

  • Add documentation of the override

Starters Deploy Preview

References

Copy link

vercel bot commented Jul 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
faststore-site ⬜️ Ignored (Inspect) Visit Preview Jul 25, 2024 11:12pm

Copy link

codesandbox-ci bot commented Jul 18, 2024

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@ataideverton ataideverton changed the title [WIP] Enable sign in override Enable sign in Button override Jul 18, 2024
@ataideverton ataideverton marked this pull request as ready for review July 18, 2024 12:48
@ataideverton ataideverton requested a review from a team as a code owner July 18, 2024 12:48
@ataideverton ataideverton requested review from gvc and eduardoformiga and removed request for a team July 18, 2024 12:48
Copy link
Member

@eduardoformiga eduardoformiga left a comment

Choose a reason for hiding this comment

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

Good job!
Do you have a starter example with this override so that we can double-check the behavior?

@ArthurTriis1
Copy link
Contributor

Good job! Do you have a starter example with this override so that we can double-check the behavior?

Yes, you can see on this preview link https://sfj-50d6569--b2bfaststoredev.preview.vtex.app/

The is PR is that https://github.com/vtex-sites/b2bfaststoredev.store/pull/74, we already merged to following with others tasks, but will update the package link after the merge

Copy link
Contributor

@hellofanny hellofanny left a comment

Choose a reason for hiding this comment

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

LGTM! 🥳

@hellofanny
Copy link
Contributor

@ataideverton I already requested the documentation updates here :)

@eduardoformiga
Copy link
Member

Good job! Do you have a starter example with this override so that we can double-check the behavior?

Yes, you can see on this preview link https://sfj-50d6569--b2bfaststoredev.preview.vtex.app/

The is PR is that vtex-sites/b2bfaststoredev.store#74, we already merged to following with others tasks, but will update the package link after the merge

I didn't manage to use this preview. The sign in button is redirecting to https://b2bdev.vtexfaststore.com/api/io/login, instead of opening the modal.

@ataideverton
Copy link
Contributor Author

@eduardoformiga The modal only opens on authenticated users

You can use our production environment b2bfaststore.vtexfaststore.com to check it out

Just do the normal login, after the redirect the modal should open (The button will have changed the text from "Sign Up" to "Company")

@eduardoformiga
Copy link
Member

eduardoformiga commented Jul 25, 2024

@eduardoformiga The modal only opens on authenticated users

You can use our production environment b2bfaststore.vtexfaststore.com to check it out

Just do the normal login, after the redirect the modal should open (The button will have changed the text from "Sign Up" to "Company")

Nice! I think it works as expected in the desktop version.
Screenshot 2024-07-25 at 15 40 08

On the mobile, I can't simulate. (the button remains as My account inside the menu, and redirecting to IO). Can you double check?
Screenshot 2024-07-25 at 15 42 12

@ataideverton
Copy link
Contributor Author

@eduardoformiga The modal only opens on authenticated users
You can use our production environment b2bfaststore.vtexfaststore.com to check it out
Just do the normal login, after the redirect the modal should open (The button will have changed the text from "Sign Up" to "Company")

Nice! I think it works as expected in the desktop version. Screenshot 2024-07-25 at 15 40 08

On the mobile, I can't simulate. (the button remains as My account inside the menu, and redirecting to IO). Can you double check? Screenshot 2024-07-25 at 15 42 12

The mobile version should be working now, i needed to make a small change.

You can test it on this preview. I have also inverted the validation on this one so you don't need to edit the cookie (Since it's a preview) and the modal should open to an unauthenticated user, just to facilitate testing.

Copy link
Member

@eduardoformiga eduardoformiga left a comment

Choose a reason for hiding this comment

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

Nice!
Screenshot 2024-08-01 at 13 35 40

@hellofanny hellofanny merged commit 0572a1f into main Aug 5, 2024
7 checks passed
@hellofanny hellofanny deleted the feat/override-sign-in-button branch August 5, 2024 13:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants