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(FX-4762): Support CTA in Toast #8627

Merged
merged 5 commits into from
May 9, 2023

Conversation

dimatretyak
Copy link
Contributor

@dimatretyak dimatretyak commented May 4, 2023

This PR resolves FX-4762

ToDo

  • Clarify paddingRight with Carlos
  • Clarify display of CTAs for middle placed toasts

Acceptance Criteria

  • Add the ability to pass the CTA for the Toast component
  • The whole toast should remain clickable, not just CTA

Demo

Before After
before-1 after-1-xs
before-2 after-2-xs

PR Checklist

  • I have tested my changes on iOS and Android.
  • I hid my changes behind a feature flag, or they don't need one.
  • I have included screenshots or videos, or I have not changed the UI.
  • I have added tests, or my changes don't require any.
  • I added an app state migration, or my changes do not require one.
  • I have documented any follow-up work that this PR will require, or it does not require any.
  • I have added a changelog entry below, or my changes do not require one.

To the reviewers 👀

  • I would like at least one of the reviewers to run this PR on the simulator or device.
Changelog updates

Changelog updates

Cross-platform user-facing changes

  • Support CTA in Toast - dimatretyak

iOS user-facing changes

Android user-facing changes

Dev changes

Need help with something? Have a look at our docs, or get in touch with us.

@dimatretyak dimatretyak self-assigned this May 4, 2023
@@ -128,7 +137,6 @@ export const ToastComponent = ({
backgroundColor={color(backgroundColor)}
opacity={opacityAnim.interpolate({ inputRange: [0, 1], outputRange: [0, 1] })}
overflow="hidden"
paddingRight={2}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

paddingRight prop was added in this PR. I checked with @araujobarret, he doesn't mind if we remove it (since there is some UI problem when clicking on toast because of this. See attached video)

Video Screenshots
demo.mp4
demo

@@ -30,6 +29,7 @@ export const ToastComponent = ({
Icon,
backgroundColor = "black100",
duration = "short",
cta,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

question: should we support "CTA" for toasts placed in the middle? It seems to me that this is not necessary. what do you think? 🤔

for-question

Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure, this kind of middle CTA doesn't even exist in our DS, I'd expect the toasts we have there with the desired position.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, good point!

@@ -17,10 +17,16 @@ export interface ToastDetails {
placement: ToastPlacement
message: string

/* Display CTA for toasts with top or bottom placement */
cta?: string
Copy link
Contributor Author

Choose a reason for hiding this comment

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

or is ctaText better?

Copy link
Contributor

Choose a reason for hiding this comment

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

personal opinion: cta of type string it's already self-explanatory to me 👍

@dimatretyak dimatretyak marked this pull request as ready for review May 5, 2023 12:27
@dimatretyak dimatretyak merged commit fe8aa88 into main May 9, 2023
@dimatretyak dimatretyak deleted the dimatretyak/feat/add-cta-for-toasts branch May 9, 2023 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants