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 icon color in Toaster #2384

Merged
merged 4 commits into from
Nov 27, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions src/components/Toastr/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const TOAST_ICON = {
),
error: (
<Warning
className="neeto-ui-white"
className="neeto-ui-text-white"
data-cy="error-toast-icon"
data-testid="error-toast-icon"
/>
Expand Down Expand Up @@ -99,7 +99,12 @@ const withUniqueCheck =
if (toastrList.add({ type, message, buttonLabel })) {
const config = {
...TOAST_CONFIG,
icon: showIcon && TOAST_ICON[type],
// The false value of the icon was ignored in the implementations before v9.0.2.
// After 9.0.2, the implementation is such that the icon is rendered as passed in the config.
// Since the `false` value used to show the default icon set internally, used a function that returns null
// which solved the problem.
// PR which addressed this issue: https://github.com/fkhadra/react-toastify/pull/758
icon: showIcon ? TOAST_ICON[type] : () => null,
onClose: () => toastrList.remove({ type, message, buttonLabel }),
...customConfig,
};
Expand Down
Loading