Improved Landing page
This commit is contained in:
@@ -1,10 +1,7 @@
|
||||
import { AlertOutlined } from "@ant-design/icons";
|
||||
import * as Sentry from "@sentry/react";
|
||||
import { Button, notification, Space } from "antd";
|
||||
//import "antd/dist/antd.css";
|
||||
import "antd/dist/antd.less";
|
||||
import Dinero from "dinero.js";
|
||||
import i18n from "i18next";
|
||||
import React from "react";
|
||||
import ReactDOM from "react-dom";
|
||||
import { Provider } from "react-redux";
|
||||
@@ -15,7 +12,6 @@ import LoadingSpinner from "./components/loading-spinner/loading-spinner.compone
|
||||
import "./index.css";
|
||||
import { persistor, store } from "./redux/store";
|
||||
import reportWebVitals from "./reportWebVitals";
|
||||
import * as serviceWorkerRegistration from "./serviceWorkerRegistration";
|
||||
import "./translations/i18n";
|
||||
import "./utils/CleanAxios";
|
||||
require("dotenv").config();
|
||||
@@ -52,44 +48,44 @@ ReactDOM.render(
|
||||
document.getElementById("root")
|
||||
);
|
||||
|
||||
const onServiceWorkerUpdate = (registration) => {
|
||||
console.log("onServiceWorkerUpdate", registration);
|
||||
// const onServiceWorkerUpdate = (registration) => {
|
||||
// console.log("onServiceWorkerUpdate", registration);
|
||||
|
||||
const btn = (
|
||||
<Space flex>
|
||||
<Button
|
||||
onClick={async () => {
|
||||
window.open("https://imex-online.noticeable.news/", "_blank");
|
||||
}}
|
||||
>
|
||||
{i18n.t("general.actions.viewreleasenotes")}
|
||||
</Button>
|
||||
<Button
|
||||
type="primary"
|
||||
onClick={async () => {
|
||||
if (registration && registration.waiting) {
|
||||
await registration.unregister();
|
||||
// Makes Workbox call skipWaiting()
|
||||
registration.waiting.postMessage({ type: "SKIP_WAITING" });
|
||||
// Once the service worker is unregistered, we can reload the page to let
|
||||
// the browser download a fresh copy of our app (invalidating the cache)
|
||||
window.location.reload();
|
||||
}
|
||||
}}
|
||||
>
|
||||
{i18n.t("general.actions.refresh")}
|
||||
</Button>
|
||||
</Space>
|
||||
);
|
||||
notification.open({
|
||||
icon: <AlertOutlined />,
|
||||
message: i18n.t("general.messages.newversiontitle"),
|
||||
description: i18n.t("general.messages.newversionmessage"),
|
||||
duration: 0,
|
||||
btn,
|
||||
key: "updateavailable",
|
||||
});
|
||||
};
|
||||
// const btn = (
|
||||
// <Space flex>
|
||||
// <Button
|
||||
// onClick={async () => {
|
||||
// window.open("https://imex-online.noticeable.news/", "_blank");
|
||||
// }}
|
||||
// >
|
||||
// {i18n.t("general.actions.viewreleasenotes")}
|
||||
// </Button>
|
||||
// <Button
|
||||
// type="primary"
|
||||
// onClick={async () => {
|
||||
// if (registration && registration.waiting) {
|
||||
// await registration.unregister();
|
||||
// // Makes Workbox call skipWaiting()
|
||||
// registration.waiting.postMessage({ type: "SKIP_WAITING" });
|
||||
// // Once the service worker is unregistered, we can reload the page to let
|
||||
// // the browser download a fresh copy of our app (invalidating the cache)
|
||||
// window.location.reload();
|
||||
// }
|
||||
// }}
|
||||
// >
|
||||
// {i18n.t("general.actions.refresh")}
|
||||
// </Button>
|
||||
// </Space>
|
||||
// );
|
||||
// notification.open({
|
||||
// icon: <AlertOutlined />,
|
||||
// message: i18n.t("general.messages.newversiontitle"),
|
||||
// description: i18n.t("general.messages.newversionmessage"),
|
||||
// duration: 0,
|
||||
// btn,
|
||||
// key: "updateavailable",
|
||||
// });
|
||||
// };
|
||||
|
||||
serviceWorkerRegistration.register({ onUpdate: onServiceWorkerUpdate });
|
||||
// serviceWorkerRegistration.register({ onUpdate: onServiceWorkerUpdate });
|
||||
reportWebVitals();
|
||||
|
||||
Reference in New Issue
Block a user