@asaleh37/ui-base 1.1.1 → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +9 -3
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/rollup.config-1748377725725.cjs +50 -0
- package/src/components/App.tsx +9 -6
- package/src/components/BaseApp.tsx +3 -4
- package/src/styles/index.css +1 -2
package/package.json
CHANGED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var resolve = require('@rollup/plugin-node-resolve');
|
|
6
|
+
var commonjs = require('@rollup/plugin-commonjs');
|
|
7
|
+
var typescript = require('@rollup/plugin-typescript');
|
|
8
|
+
var dts = require('rollup-plugin-dts');
|
|
9
|
+
var terser = require('@rollup/plugin-terser');
|
|
10
|
+
var json = require('@rollup/plugin-json');
|
|
11
|
+
var peerDepsExternal = require('rollup-plugin-peer-deps-external');
|
|
12
|
+
var postcss = require('rollup-plugin-postcss');
|
|
13
|
+
|
|
14
|
+
const packageJson = require("./package.json");
|
|
15
|
+
|
|
16
|
+
var rollup_config = [
|
|
17
|
+
{
|
|
18
|
+
input: "src/index.ts",
|
|
19
|
+
output: [
|
|
20
|
+
{
|
|
21
|
+
file: packageJson.main,
|
|
22
|
+
format: "cjs",
|
|
23
|
+
sourcemap: true,
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
file: packageJson.module,
|
|
27
|
+
format: "esm",
|
|
28
|
+
sourcemap: true,
|
|
29
|
+
},
|
|
30
|
+
],
|
|
31
|
+
plugins: [
|
|
32
|
+
peerDepsExternal(),
|
|
33
|
+
resolve(),
|
|
34
|
+
commonjs(),
|
|
35
|
+
typescript({ tsconfig: "./tsconfig.json" }),
|
|
36
|
+
terser(),
|
|
37
|
+
postcss(),
|
|
38
|
+
json(),
|
|
39
|
+
],
|
|
40
|
+
external: ["react", "react-dom"],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
input: "src/index.ts",
|
|
44
|
+
output: [{ file: packageJson.types }],
|
|
45
|
+
plugins: [dts.default()],
|
|
46
|
+
external: [/\.css$/],
|
|
47
|
+
},
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
exports.default = rollup_config;
|
package/src/components/App.tsx
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { useSelector } from "react-redux";
|
|
1
|
+
import { useDispatch, useSelector } from "react-redux";
|
|
2
2
|
import { createTheme } from "@mui/material";
|
|
3
3
|
import { ThemeProvider } from "@emotion/react";
|
|
4
|
-
import { useEffect } from "react";
|
|
4
|
+
import React, { useEffect } from "react";
|
|
5
5
|
import { RootState } from "../redux/store";
|
|
6
6
|
import { LightThemeOptions } from "../theme/LightThemeOptions";
|
|
7
7
|
import { DarkThemeOptions } from "../theme/DarkThemeOptions";
|
|
8
8
|
import Layout from "../layout/Layout";
|
|
9
|
+
import { AppInfo, AppInfoActions } from "../redux/features/common/AppInfoSlice";
|
|
9
10
|
|
|
10
|
-
|
|
11
|
-
const
|
|
11
|
+
const App: React.FC<AppInfo> = (props: AppInfo) => {
|
|
12
|
+
const dispatch = useDispatch();
|
|
13
|
+
console.log("App Info", props);
|
|
14
|
+
dispatch(AppInfoActions.setAppInfo(props));
|
|
12
15
|
const AppLayoutState = useSelector((state: RootState) => state.AppLayout);
|
|
13
16
|
let themeOptions = { ...LightThemeOptions };
|
|
14
17
|
if (AppLayoutState.themeMode === "dark") {
|
|
@@ -19,13 +22,13 @@ function App() {
|
|
|
19
22
|
...themeOptions,
|
|
20
23
|
});
|
|
21
24
|
useEffect(() => {
|
|
22
|
-
document.title =
|
|
25
|
+
document.title = props.documentTitle;
|
|
23
26
|
}, []);
|
|
24
27
|
return (
|
|
25
28
|
<ThemeProvider theme={theme}>
|
|
26
29
|
<Layout />
|
|
27
30
|
</ThemeProvider>
|
|
28
31
|
);
|
|
29
|
-
}
|
|
32
|
+
};
|
|
30
33
|
|
|
31
34
|
export default App;
|
|
@@ -12,17 +12,16 @@ LicenseInfo.setLicenseKey(
|
|
|
12
12
|
);
|
|
13
13
|
import "react-toastify/dist/ReactToastify.css";
|
|
14
14
|
import App from "./App";
|
|
15
|
+
import { AppInfo } from "../redux/features/common/AppInfoSlice";
|
|
15
16
|
|
|
16
17
|
library.add(fab);
|
|
17
18
|
library.add(far);
|
|
18
19
|
library.add(fas);
|
|
19
20
|
|
|
20
|
-
export
|
|
21
|
-
|
|
22
|
-
export const BaseApp: React.FC<BaseAppProps> = (props) => {
|
|
21
|
+
export const BaseApp: React.FC<AppInfo> = (props) => {
|
|
23
22
|
return (
|
|
24
23
|
<Provider store={store}>
|
|
25
|
-
<App />
|
|
24
|
+
<App {...props} />
|
|
26
25
|
</Provider>
|
|
27
26
|
);
|
|
28
27
|
};
|