refactor: dayjs and tippy setting

This commit is contained in:
Tristan Yang
2022-07-17 22:02:57 +08:00
parent 963fd9a0a3
commit 37ad42170e
9 changed files with 36 additions and 53 deletions
+20 -22
View File
@@ -1,29 +1,27 @@
import ReactDOM from 'react-dom/client';
import toast, { Toaster } from 'react-hot-toast';
import { Reset } from 'styled-reset';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import './assets/base.css';
import 'animate.css';
import * as serviceWorkerRegistration from './serviceWorkerRegistration';
import TippyDefault from './common/component/TippyDefault';
import MarkdownStyleOverride from './common/component/MarkdownStyleOverride';
import ReduxRoutes from './routes';
import NewVersion from './common/component/NewVersion';
import ReactDOM from "react-dom/client";
import toast, { Toaster } from "react-hot-toast";
import { Reset } from "styled-reset";
import { DndProvider } from "react-dnd";
import { HTML5Backend } from "react-dnd-html5-backend";
import "./assets/base.css";
import "animate.css";
import "./common/DayjsSetting";
import "./common/TippySetting";
import * as serviceWorkerRegistration from "./serviceWorkerRegistration";
import MarkdownStyleOverride from "./common/component/MarkdownStyleOverride";
import ReduxRoutes from "./routes";
import NewVersion from "./common/component/NewVersion";
const root = ReactDOM.createRoot(
document.getElementById('root') as HTMLElement
);
const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement);
root.render(
<>
<Reset/>
<Toaster/>
<TippyDefault/>
<Reset />
<Toaster />
<DndProvider backend={HTML5Backend}>
<ReduxRoutes/>
<ReduxRoutes />
</DndProvider>
<MarkdownStyleOverride/>
<MarkdownStyleOverride />
</>
);
@@ -37,9 +35,9 @@ serviceWorkerRegistration.register({
window.location.reload();
});
};
toast((t) => <NewVersion id={t.id} handleUpdate={handleUpdate}/>, {
toast((t) => <NewVersion id={t.id} handleUpdate={handleUpdate} />, {
duration: Infinity,
position: 'top-right'
position: "top-right"
});
}
});