From c31bd2d190ba0bd060d153ac996306ba0da70364 Mon Sep 17 00:00:00 2001 From: Alican Erdurmaz Date: Mon, 16 Oct 2023 17:56:45 +0300 Subject: [PATCH] feat: use new antd notification provider (#375) --- refine-nextjs/plugins/antd/extend.js | 10 +++++++--- refine-react/plugins/antd/extend.js | 7 ++++--- refine-remix/plugins/antd/extend.js | 10 +++++++--- refine-vite/plugins/antd/extend.js | 7 ++++--- 4 files changed, 22 insertions(+), 12 deletions(-) diff --git a/refine-nextjs/plugins/antd/extend.js b/refine-nextjs/plugins/antd/extend.js index c88569694..2f0b7ef34 100644 --- a/refine-nextjs/plugins/antd/extend.js +++ b/refine-nextjs/plugins/antd/extend.js @@ -1,14 +1,18 @@ const base = { _app: { - refineProps: ["notificationProvider={notificationProvider}"], - import: ['import "@refinedev/antd/dist/reset.css";'], + refineProps: ["notificationProvider={useNotificationProvider}"], + import: [ + `import { App as AntdApp } from "antd"`, + 'import "@refinedev/antd/dist/reset.css";', + ], refineAntdImports: [ - "notificationProvider", + "useNotificationProvider", "ThemedLayoutV2", "ThemedSiderV2", ], wrapper: [ [``, ``], + [``, ``], ], localImport: [ `import { Header } from "@components/header"`, diff --git a/refine-react/plugins/antd/extend.js b/refine-react/plugins/antd/extend.js index 3cb6da8bb..20fec102e 100644 --- a/refine-react/plugins/antd/extend.js +++ b/refine-react/plugins/antd/extend.js @@ -1,11 +1,12 @@ const base = { _app: { - import: [], + import: [`import { App as AntdApp } from "antd"`], refineImports: [], - refineAntdImports: ["notificationProvider", "ThemedLayoutV2"], - refineProps: ["notificationProvider={notificationProvider}"], + refineAntdImports: ["useNotificationProvider", "ThemedLayoutV2"], + refineProps: ["notificationProvider={useNotificationProvider}"], wrapper: [ [``, ``], + [``, ``], ], localImport: [ `import { ColorModeContextProvider } from "./contexts/color-mode";`, diff --git a/refine-remix/plugins/antd/extend.js b/refine-remix/plugins/antd/extend.js index 4ac9a28a1..36e787878 100644 --- a/refine-remix/plugins/antd/extend.js +++ b/refine-remix/plugins/antd/extend.js @@ -1,11 +1,15 @@ const base = { _app: { - refineProps: ["notificationProvider={notificationProvider}"], - import: ['import resetStyle from "@refinedev/antd/dist/reset.css";'], - refineAntdImports: ["notificationProvider"], + refineProps: ["notificationProvider={useNotificationProvider}"], + import: [ + `import { App as AntdApp } from "antd"`, + 'import resetStyle from "@refinedev/antd/dist/reset.css";', + ], + refineAntdImports: ["useNotificationProvider"], styleImport: ['{ rel: "stylesheet", href: resetStyle }'], wrapper: [ [``, ``], + [``, ``], ], localImport: [`import { ColorModeContextProvider } from "@contexts";`], }, diff --git a/refine-vite/plugins/antd/extend.js b/refine-vite/plugins/antd/extend.js index 9831c36b8..eadb46c03 100644 --- a/refine-vite/plugins/antd/extend.js +++ b/refine-vite/plugins/antd/extend.js @@ -1,15 +1,16 @@ const base = { _app: { - import: [], + import: [`import { App as AntdApp } from "antd"`], refineImports: [], refineAntdImports: [ - "notificationProvider", + "useNotificationProvider", "ThemedLayoutV2", "ThemedSiderV2", ], - refineProps: ["notificationProvider={notificationProvider}"], + refineProps: ["notificationProvider={useNotificationProvider}"], wrapper: [ [``, ``], + [``, ``], ], localImport: [ `import { ColorModeContextProvider } from "./contexts/color-mode";`,