Skip to content

Commit 708aaa9

Browse files
Merge pull request #1352 from syucream/fix/externalize-notistack
Make notistack externals to allow custom views to use/customize the notifications
2 parents f4857e8 + 41f1850 commit 708aaa9

File tree

8 files changed

+22
-21
lines changed

8 files changed

+22
-21
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ node_modules
172172
static/js/ui.js*
173173
coverage
174174
frontend/dist
175+
*.tgz
175176

176177
# local django configuration
177178
airone/settings.py

frontend/src/App.tsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { ThemeProvider } from "@mui/material";
22
import React, { StrictMode } from "react";
33
import { createRoot } from "react-dom/client";
44

5+
import { AironeSnackbarProvider } from "AironeSnackbarProvider";
56
import { AppBase } from "AppBase";
67
import { theme } from "Theme";
78

@@ -13,7 +14,9 @@ const root = createRoot(container);
1314
root.render(
1415
<StrictMode>
1516
<ThemeProvider theme={theme}>
16-
<AppBase />
17+
<AironeSnackbarProvider>
18+
<AppBase />
19+
</AironeSnackbarProvider>
1720
</ThemeProvider>
1821
</StrictMode>
1922
);

frontend/src/AppBase.tsx

+5-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import React, { FC } from "react";
22

3-
import { AironeSnackbarProvider } from "AironeSnackbarProvider";
43
import { ErrorHandler } from "ErrorHandler";
54
import { CheckTerms } from "components/common/CheckTerms";
65
import { AppRouter } from "routes/AppRouter";
@@ -15,12 +14,10 @@ interface Props {
1514

1615
export const AppBase: FC<Props> = ({ customRoutes }) => {
1716
return (
18-
<AironeSnackbarProvider>
19-
<ErrorHandler>
20-
<CheckTerms>
21-
<AppRouter customRoutes={customRoutes} />
22-
</CheckTerms>
23-
</ErrorHandler>
24-
</AironeSnackbarProvider>
17+
<ErrorHandler>
18+
<CheckTerms>
19+
<AppRouter customRoutes={customRoutes} />
20+
</CheckTerms>
21+
</ErrorHandler>
2522
);
2623
};

frontend/src/apiclient/autogenerated/.gitkeep

Whitespace-only changes.

frontend/src/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export * from "./AppBase";
2-
2+
export * from "./AironeSnackbarProvider";
33
export * from "./components";
44
export * from "./hooks";
55
export * from "./i18n";

package-lock.json

+7-7
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dmm-com/pagoda-core",
3-
"version": "1.0.2",
3+
"version": "1.0.3",
44
"description": "[![CircleCI](https://circleci.com/gh/dmm-com/airone.svg?style=svg&circle-token=2e12c068b0ed1bab9d0c2d72529d5ee1da9b53b4)](https://circleci.com/gh/dmm-com/airone)",
55
"main": "frontend/dist/pagoda-core.js",
66
"types": "frontend/dist/index.d.ts",
@@ -27,7 +27,7 @@
2727
"fix": "npx eslint --fix frontend ; npx prettier --write frontend",
2828
"test": "TZ=UTC npx jest --coverage frontend",
2929
"test:update": "TZ=UTC npx jest -u frontend",
30-
"build:lib": "npm run build:lib:code && npm run build:lib:types",
30+
"build:lib": "rm -rf frontend/dist && npm run build:lib:code && npm run build:lib:types",
3131
"build:lib:code": "webpack --config webpack.library.config.js --mode development",
3232
"build:lib:types": "tsc --project tsconfig.lib.json"
3333
},
@@ -91,7 +91,6 @@
9191
"js-file-download": "^0.4.12",
9292
"material-ui-popup-state": "^5.0.10",
9393
"msw": "^2.0.11",
94-
"notistack": "^3.0.1",
9594
"prettier": "2.3.2",
9695
"prop-types": "^15.7.2",
9796
"react": "^18.2.0",
@@ -119,6 +118,7 @@
119118
},
120119
"peerDependencies": {
121120
"@mui/material": "^5.11.3",
121+
"notistack": "^3.0.1",
122122
"react": "^18.0.0",
123123
"react-dom": "^18.0.0",
124124
"react-router-dom": "^6.0.0"

webpack.library.config.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,5 @@ module.exports = {
3939
'node_modules',
4040
],
4141
},
42-
externals: ['@mui/material', 'react', 'react-dom', 'react-router-dom'],
42+
externals: ['@mui/material', 'react', 'react-dom', 'react-router-dom', 'notistack'],
4343
}

0 commit comments

Comments
 (0)