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

Fix the NotificationToast transition issues #1355

Merged
merged 6 commits into from
Jan 11, 2022

Conversation

amelako
Copy link
Contributor

@amelako amelako commented Jan 11, 2022

Purpose

Regarding the transitions when the toast appears, its a bit hard and jumps a bit in its height. There was an issue with disappear transitions too, where the toast is animated to half the height and then fades out.

Approach and changes

To fix the issues following changes were done:

  • Initialize the toast visibility to false so that the toast animates in.
  • Added an additional div around the toast content to fix the height transition issue. The padding needs to be on the inner div.
  • Renamed the timeout to transition duration for better readability.

Definition of done

  • Development completed
  • Reviewers assigned
  • Unit and integration tests
  • Meets minimum browser support
  • Meets accessibility requirements

@amelako amelako requested a review from a team as a code owner January 11, 2022 12:59
@changeset-bot
Copy link

changeset-bot bot commented Jan 11, 2022

🦋 Changeset detected

Latest commit: 5f692ac

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@sumup/circuit-ui Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@sumup-clark
Copy link

sumup-clark bot commented Jan 11, 2022

Hey @amelako,
we are super excited that you are contributing! 🎉There's one more thing you need to do. Please accept our Contributor License Agreement. It helps you and us to collaborate on clear terms and focus on what we love most: code.

Thanks!

@vercel
Copy link

vercel bot commented Jan 11, 2022

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/sumup/oss-circuit-ui/7JDSH1hErW1N8rT8kc8bHeF3MEjF
✅ Preview: https://oss-circuit-ui-git-notification-toast-animations-fix-sumup.vercel.app

@codecov
Copy link

codecov bot commented Jan 11, 2022

Codecov Report

Merging #1355 (5f692ac) into main (24e500c) will decrease coverage by 0.01%.
The diff coverage is 85.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #1355      +/-   ##
==========================================
- Coverage   92.24%   92.22%   -0.02%     
==========================================
  Files         189      190       +1     
  Lines        3776     3780       +4     
  Branches     1175     1175              
==========================================
+ Hits         3483     3486       +3     
- Misses        275      276       +1     
  Partials       18       18              
Impacted Files Coverage Δ
...cuit-ui/components/LoadingButton/LoadingButton.tsx 0.00% <0.00%> (ø)
...ircuit-ui/components/ModalContext/ModalContext.tsx 91.48% <ø> (ø)
...ircuit-ui/components/ToastContext/ToastContext.tsx 92.10% <ø> (ø)
...components/NotificationToast/NotificationToast.tsx 90.90% <77.77%> (+0.43%) ⬆️
packages/circuit-ui/components/Modal/Modal.tsx 82.05% <100.00%> (ø)
...components/NotificationModal/NotificationModal.tsx 96.66% <100.00%> (ø)
...n/components/MobileNavigation/MobileNavigation.tsx 100.00% <100.00%> (ø)
packages/circuit-ui/hooks/useStack/useStack.ts 93.33% <100.00%> (+0.22%) ⬆️

@connor-baer connor-baer changed the title Fix the NotificationToast transitions issues Fix the NotificationToast transition issues Jan 11, 2022
@connor-baer connor-baer added the 🐞 bug Something isn't working as it should label Jan 11, 2022
Co-authored-by: Connor Bär <connor-baer@users.noreply.github.com>
Copy link
Contributor

@robinmetral robinmetral left a comment

Choose a reason for hiding this comment

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

Noice 🐛

border-radius: ${theme.borderRadius.byte};
border: ${theme.borderWidth.mega} solid ${theme.colors[colorMap[variant]]};
overflow: hidden;
transition: opacity 200ms ease-in-out, height 200ms ease-in-out,
visibility 200ms ease-in-out;
will-change: height;
Copy link
Contributor

Choose a reason for hiding this comment

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

Did you notice a change when adding this? Curious

Copy link
Member

@connor-baer connor-baer Jan 11, 2022

Choose a reason for hiding this comment

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

Not really, I think this would only be noticeable on older hardware.

@amelako amelako merged commit d08ad56 into main Jan 11, 2022
@amelako amelako deleted the notification-toast-animations-fix branch January 11, 2022 13:20
@github-actions github-actions bot mentioned this pull request Jan 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🐞 bug Something isn't working as it should 🗂 circuit-ui
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants