Skip to content

Commit

Permalink
fix: process.env.NODE_ENV warning and create/refactor LoadingPage
Browse files Browse the repository at this point in the history
  • Loading branch information
jimcase committed May 7, 2024
1 parent 30c7878 commit 58e4843
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 11 deletions.
10 changes: 2 additions & 8 deletions src/ui/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,10 @@ import { TabsRoutePath } from "../routes/paths";
import { MobileHeaderPreview } from "./components/MobileHeaderPreview";
import { CustomToast } from "./components/CustomToast/CustomToast";
import { LockPage } from "./pages/LockPage/LockPage";
import { LoadingPage } from "./pages/LoadingPage/LoadingPage";

setupIonicReact();

const LoadingPage = () => {
return (
<div className="loading-page">
<IonSpinner name="crescent" />
</div>
);
};
const App = () => {
const stateCache = useAppSelector(getStateCache);
const authentication = useAppSelector(getAuthentication);
Expand Down Expand Up @@ -123,7 +117,7 @@ const App = () => {
{!authentication.loggedIn ? <LockPage /> : null}
</>
) : (
LoadingPage()
<LoadingPage />
)}
<SetUserName
isOpen={showSetUserName}
Expand Down
8 changes: 8 additions & 0 deletions src/ui/pages/LoadingPage/LoadingPage.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.loading-page {
display: flex;
align-items: center;
justify-content: center;
height: 100vh;
width: 100vw;
z-index: 2147483646;
}
12 changes: 12 additions & 0 deletions src/ui/pages/LoadingPage/LoadingPage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { IonSpinner } from "@ionic/react";
import "./LoadingPage.scss";

const LoadingPage = () => {
return (
<div className="loading-page">
<IonSpinner name="crescent" />
</div>
);
};

export { LoadingPage };
1 change: 0 additions & 1 deletion webpack/webpack.common.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,6 @@ const config = {
}),
new webpack.DefinePlugin({
VERSION: JSON.stringify(require("../package.json").version),
"process.env.NODE_ENV": JSON.stringify(process.env.NODE_ENV),
"process.env": JSON.stringify(process.env)
}),
new webpack.ProvidePlugin({
Expand Down
7 changes: 5 additions & 2 deletions webpack/webpack.dev.cjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
let { merge } = require("webpack-merge");
const webpack = require("webpack");

module.exports = merge(require("./webpack.common.cjs"), {
mode: 'development',
mode: "development",
module: {
rules: [
{
Expand Down Expand Up @@ -38,6 +39,8 @@ module.exports = merge(require("./webpack.common.cjs"), {
},
},
plugins: [

new webpack.DefinePlugin({
"process.env.NODE_ENV": JSON.stringify("development"),
}),
]
});

0 comments on commit 58e4843

Please sign in to comment.