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: Update NotificationToast provider with position and className props #2577

Merged
merged 13 commits into from
Jun 17, 2024

Conversation

voronianski
Copy link
Member

@voronianski voronianski commented Jun 11, 2024

Addresses WPS-207.

Purpose

In certain applications (e.g. shop or marketing website) it's necessary to change the placement of NotificationToast (e.g. put it closer to shopping cart). Unfortunately current implementation displays NotificationToasts only at the bottom of a page. This PR extends NotificationToast position possibilities by providing a prop that can place NotificationToast at the top and at the top right corner of a page.

Approach and changes

  • add position prop to ToastProvider with bottom, top and top-right as possible values (use bottom as default value)
  • add CSS classes and styles for each position
  • update storybook with examples and documentation
  • additionally add className prop to ToastProvider to allow slight modifications (e.g. using bigger CSS space variable for a position)

Definition of done

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

Copy link

vercel bot commented Jun 11, 2024

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

Name Status Preview Comments Updated (UTC)
oss-circuit-ui ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jun 13, 2024 5:26pm

Copy link

changeset-bot bot commented Jun 11, 2024

🦋 Changeset detected

Latest commit: e88777e

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

This PR includes changesets to release 2 packages
Name Type
@sumup/circuit-ui Minor
@sumup/eslint-plugin-circuit-ui Major

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

Copy link

codecov bot commented Jun 11, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.16%. Comparing base (347dc9a) to head (e88777e).
Report is 8 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #2577   +/-   ##
=======================================
  Coverage   88.16%   88.16%           
=======================================
  Files         204      204           
  Lines       22320    22331   +11     
  Branches     1490     1490           
=======================================
+ Hits        19678    19689   +11     
  Misses       2590     2590           
  Partials       52       52           
Files Coverage Δ
...ircuit-ui/components/ToastContext/ToastContext.tsx 100.00% <100.00%> (ø)

@voronianski voronianski changed the title feat: add toast positioning prop feat: Update NotificationToast with position and className props Jun 12, 2024
@voronianski voronianski marked this pull request as ready for review June 12, 2024 15:42
@voronianski voronianski requested a review from a team as a code owner June 12, 2024 15:42
@voronianski voronianski requested review from connor-baer and removed request for a team June 12, 2024 15:42
@voronianski voronianski changed the title feat: Update NotificationToast with position and className props feat: Update NotificationToast provider with position and className props Jun 12, 2024
voronianski and others added 3 commits June 13, 2024 18:50
Co-authored-by: Connor Bär <connor-baer@users.noreply.github.com>
Co-authored-by: Connor Bär <connor-baer@users.noreply.github.com>
Co-authored-by: Connor Bär <connor-baer@users.noreply.github.com>
Copy link
Member

@connor-baer connor-baer left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution! 🙌🏻

@voronianski voronianski merged commit c3dc064 into main Jun 17, 2024
13 of 14 checks passed
@voronianski voronianski deleted the wps-207-cart-notification-position branch June 17, 2024 08:25
@connor-baer connor-baer mentioned this pull request Jun 17, 2024
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.

2 participants