✨(react) add ToastProvider to CunninghamProvider
This allows the consumer to use useToastProvider very easily, it avoids thinking of explicity adding ToastProvider to apps that needs toasts.
This commit is contained in:
@@ -9,6 +9,7 @@ import * as enUS from ":/locales/en-US.json";
|
|||||||
import * as frFR from ":/locales/fr-FR.json";
|
import * as frFR from ":/locales/fr-FR.json";
|
||||||
import { PartialNested } from ":/types";
|
import { PartialNested } from ":/types";
|
||||||
import { Locales } from ":/components/Provider/Locales";
|
import { Locales } from ":/components/Provider/Locales";
|
||||||
|
import { ToastProvider } from ":/components/Toast/ToastProvider";
|
||||||
|
|
||||||
type TranslationSet = PartialNested<typeof enUS>;
|
type TranslationSet = PartialNested<typeof enUS>;
|
||||||
|
|
||||||
@@ -100,7 +101,7 @@ export const CunninghamProvider = ({
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<CunninghamContext.Provider value={context}>
|
<CunninghamContext.Provider value={context}>
|
||||||
{children}
|
<ToastProvider>{children}</ToastProvider>
|
||||||
</CunninghamContext.Provider>
|
</CunninghamContext.Provider>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user