Skip to content

Commit bc464c5

Browse files
chore(deps): bump react-toastify from 9.1.3 to 11.1.0
1 parent 330c434 commit bc464c5

9 files changed

Lines changed: 52 additions & 25 deletions

File tree

client/app/lib/components/core/__test__/__snapshots__/ErrorText.test.tsx.snap

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,11 @@ exports[`<ErrorText /> when input is a string displays it 1`] = `
1010
>
1111
An error.
1212
</p>
13-
<div
13+
<section
14+
aria-atomic="false"
15+
aria-label="Notifications Alt+T"
16+
aria-live="polite"
17+
aria-relevant="additions text"
1418
class="Toastify"
1519
/>
1620
</div>
@@ -21,7 +25,11 @@ exports[`<ErrorText /> when input is a string displays it 1`] = `
2125
>
2226
An error.
2327
</p>
24-
<div
28+
<section
29+
aria-atomic="false"
30+
aria-label="Notifications Alt+T"
31+
aria-live="polite"
32+
aria-relevant="additions text"
2533
class="Toastify"
2634
/>
2735
</div>,
@@ -94,7 +102,11 @@ exports[`<ErrorText /> when input is an array displays each error 1`] = `
94102
>
95103
Another error.
96104
</p>
97-
<div
105+
<section
106+
aria-atomic="false"
107+
aria-label="Notifications Alt+T"
108+
aria-live="polite"
109+
aria-relevant="additions text"
98110
class="Toastify"
99111
/>
100112
</div>
@@ -110,7 +122,11 @@ exports[`<ErrorText /> when input is an array displays each error 1`] = `
110122
>
111123
Another error.
112124
</p>
113-
<div
125+
<section
126+
aria-atomic="false"
127+
aria-label="Notifications Alt+T"
128+
aria-live="polite"
129+
aria-relevant="additions text"
114130
class="Toastify"
115131
/>
116132
</div>,

client/app/lib/components/core/__test__/__snapshots__/LoadingIndicator.test.tsx.snap

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,11 @@ exports[`<LoadingIndicator /> matches the snapshot 1`] = `
2727
</svg>
2828
</span>
2929
</div>
30-
<div
30+
<section
31+
aria-atomic="false"
32+
aria-label="Notifications Alt+T"
33+
aria-live="polite"
34+
aria-relevant="additions text"
3135
class="Toastify"
3236
/>
3337
</div>

client/app/lib/components/core/buttons/__test__/__snapshots__/DeleteButton.test.tsx.snap

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ exports[`<DeleteButton /> when the delete button is rendered without confirmatio
3030
/>
3131
</button>
3232
</span>
33-
<div
33+
<section
34+
aria-atomic="false"
35+
aria-label="Notifications Alt+T"
36+
aria-live="polite"
37+
aria-relevant="additions text"
3438
class="Toastify"
3539
/>
3640
</div>

client/app/lib/components/core/buttons/__test__/__snapshots__/EditButton.test.tsx.snap

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,11 @@ exports[`<EditButton /> matches the snapshot 1`] = `
3030
/>
3131
</button>
3232
</span>
33-
<div
33+
<section
34+
aria-atomic="false"
35+
aria-label="Notifications Alt+T"
36+
aria-live="polite"
37+
aria-relevant="additions text"
3438
class="Toastify"
3539
/>
3640
</div>

client/app/lib/components/wrappers/ToastProvider.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
import { ReactNode } from 'react';
22
import { ToastContainer, TypeOptions } from 'react-toastify';
3-
import { injectStyle } from 'react-toastify/dist/inject-style';
43
import { Close } from '@mui/icons-material';
54

6-
injectStyle();
5+
import 'react-toastify/dist/ReactToastify.css';
76

87
export const DEFAULT_TOAST_TIMEOUT_MS = 5000 as const;
98

@@ -26,13 +25,14 @@ const ToastProvider = (props: ToastProviderProps): JSX.Element => {
2625

2726
<ToastContainer
2827
autoClose={DEFAULT_TOAST_TIMEOUT_MS}
29-
bodyClassName={(): string => 'flex'}
28+
className="flex"
3029
closeButton={<Close />}
30+
closeOnClick
3131
draggable={false}
3232
hideProgressBar
3333
position="bottom-center"
3434
toastClassName={(toast): string =>
35-
`relative shadow-xl rounded-lg mb-4 flex p-5 items-start justify-between ${
35+
`relative shadow-xl rounded-lg mb-4 flex p-5 items-start justify-between w-[320px] [&_p]:w-full ${
3636
colors[toast?.type ?? 'default']
3737
}`
3838
}

client/app/lib/hooks/toast/toast.tsx

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ interface PromisedToastMessages {
2424
success?: ReactNode;
2525
}
2626

27-
type PromisedToaster = <T = unknown>(
28-
data: Promise<T>,
29-
messages: PromisedToastMessages,
30-
options?: ToastOptions,
31-
) => Promise<T>;
32-
3327
/**
3428
* `UpdateOptions` also allows for `render` to be a function of type
3529
* `<P,>(props: ToastContentProps<P>) => ReactNode`. Here, we define
@@ -108,8 +102,12 @@ const loading: Toaster = (message, options?) =>
108102
const update = (id: Id, options?: NodeOnlyUpdateOptions): void =>
109103
toastify.update(id, customize(options));
110104

111-
const promise: PromisedToaster = (data, messages, options?) => {
112-
return toastify.promise(
105+
const promise = <T,>(
106+
data: Promise<T>,
107+
messages: PromisedToastMessages,
108+
options?: ToastOptions<T>,
109+
): Promise<T> => {
110+
return toastify.promise<T>(
113111
data,
114112
{
115113
pending: messages.pending

client/css-includes.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"node_modules/rc-slider/assets",
44
"node_modules/react-image-crop/dist/ReactCrop.css",
55
"node_modules/react-tooltip/dist/react-tooltip.min.css",
6+
"node_modules/react-toastify/dist/ReactToastify.css",
67
"node_modules/coursemology-ckeditor/build/index.css",
78
"app/lib/components/core/fields/CKEditor.css",
89
"app/lib/components/core/fields/AceEditor.css"

client/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@
9292
"react-resizable": "^3.1.3",
9393
"react-router-dom": "^6.30.3",
9494
"react-scroll": "^1.9.0",
95-
"react-toastify": "^9.1.3",
95+
"react-toastify": "^11.1.0",
9696
"react-tooltip": "^5.26.0",
9797
"react-window": "^2.2.7",
9898
"react-xarrows": "^2.0.2",

client/yarn.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12013,12 +12013,12 @@ react-to-print@^2.8.0:
1201312013
dependencies:
1201412014
prop-types "^15.8.1"
1201512015

12016-
react-toastify@^9.1.3:
12017-
version "9.1.3"
12018-
resolved "https://registry.yarnpkg.com/react-toastify/-/react-toastify-9.1.3.tgz#1e798d260d606f50e0fab5ee31daaae1d628c5ff"
12019-
integrity sha512-fPfb8ghtn/XMxw3LkxQBk3IyagNpF/LIKjOBflbexr2AWxAH1MJgvnESwEwBn9liLFXgTKWgBSdZpw9m4OTHTg==
12016+
react-toastify@^11.1.0:
12017+
version "11.1.0"
12018+
resolved "https://registry.yarnpkg.com/react-toastify/-/react-toastify-11.1.0.tgz#3d3c73a44d5cac868ee9a52e0f90dd706532c4a4"
12019+
integrity sha512-e9h23x3phN0wbFeB6yovmWp7lobzV4CaCH0LO8nVP6H7Y+3GbcLpIzMm9dJhcp1RXbpyfvjgpfXqO80QAmn7sg==
1202012020
dependencies:
12021-
clsx "^1.1.1"
12021+
clsx "^2.1.1"
1202212022

1202312023
react-tooltip@^5.26.0:
1202412024
version "5.26.0"

0 commit comments

Comments
 (0)