refactor: add typescript support to project

This commit is contained in:
HD
2022-06-29 16:54:58 +08:00
parent ccfee28e13
commit 003353e43f
33 changed files with 358 additions and 224 deletions
+7 -4
View File
@@ -1,6 +1,6 @@
import { Suspense, useEffect, lazy } from "react";
import { Route, Routes, HashRouter } from "react-router-dom";
import { Provider, useSelector } from "react-redux";
import { Provider } from "react-redux";
import toast from "react-hot-toast";
import NotFoundPage from "./404";
// import Welcome from './Welcome'
@@ -25,16 +25,19 @@ import Meta from "../common/component/Meta";
import HomePage from "./home";
import ChatPage from "./chat";
import Loading from "../common/component/Loading";
import store from "../app/store";
import store, { useAppSelector } from "../app/store";
const PageRoutes = () => {
const { ui: { online }, fileMessages } = useSelector((store) => {
const {
ui: { online },
fileMessages
} = useAppSelector((store) => {
return { ui: store.ui, fileMessages: store.fileMessage };
});
// 掉线检测
useEffect(() => {
let toastId = '0';
let toastId = "0";
if (!online) {
toast.error("Network Offline!", { duration: Infinity });
} else {