diff --git a/package.json b/package.json index 6419d639..6cdaf863 100644 --- a/package.json +++ b/package.json @@ -48,7 +48,6 @@ "react": "^18.2.0", "react-beautiful-dnd": "^13.1.0", "react-color-palette": "^6.2.0", - "react-detect-offline": "^2.4.5", "react-div-100vh": "^0.7.0", "react-dnd": "^16.0.1", "react-dnd-html5-backend": "^16.0.1", diff --git a/src/components/Table/EmptyTable.tsx b/src/components/Table/EmptyTable.tsx index 2301f43e..2fb06875 100644 --- a/src/components/Table/EmptyTable.tsx +++ b/src/components/Table/EmptyTable.tsx @@ -1,5 +1,4 @@ import { useAtom, useSetAtom } from "jotai"; -import { Offline, Online } from "react-detect-offline"; import { Grid, Stack, Typography, Button, Divider } from "@mui/material"; import { @@ -142,36 +141,34 @@ export default function EmptyTable() { ); } - return ( - <> - - - - - - - {contents} - - - - ); + if (navigator.onLine) { + return ( + + {contents} + + ); + } else { + return ( + + ); + } } diff --git a/src/components/TableToolbar/LoadedRowsStatus.tsx b/src/components/TableToolbar/LoadedRowsStatus.tsx index 6a1465fa..cf0499be 100644 --- a/src/components/TableToolbar/LoadedRowsStatus.tsx +++ b/src/components/TableToolbar/LoadedRowsStatus.tsx @@ -1,6 +1,5 @@ import { Suspense, forwardRef } from "react"; import { useAtom } from "jotai"; -import { Offline, Online } from "react-detect-offline"; import { Tooltip, Typography, TypographyProps } from "@mui/material"; import SyncIcon from "@mui/icons-material/Sync"; @@ -78,22 +77,20 @@ function LoadedRowsStatus() { } export default function SuspendedLoadedRowsStatus() { - return ( - <> - - {loadingIcon}Loading…}> - - - - - - - - - Offline - - - - - ); + if (navigator.onLine) { + return ( + {loadingIcon}Loading…}> + + + ); + } else { + return ( + + + + Offline + + + ); + } } diff --git a/yarn.lock b/yarn.lock index 1294acd5..24f8010f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7451,10 +7451,35 @@ react-color-palette@^6.2.0: resolved "https://registry.yarnpkg.com/react-color-palette/-/react-color-palette-6.2.0.tgz#aa3be88f6953d57502c00f4433692129ffbad3e7" integrity sha512-9rIboaRJNoeF8aCI2f3J8wgMyhl74SnGmZLDjor3bKf0iDBhP2EBv0/jGmm0hrj6OackGCqtWl5ZvM89XUc3sg== -react-detect-offline@^2.4.5: - version "2.4.5" - resolved "https://registry.yarnpkg.com/react-detect-offline/-/react-detect-offline-2.4.5.tgz#3c242516c37b6789cf89102881031f87e70b80e6" - integrity sha512-sI13NPEKl3uQp95FT5CwrYzH3DnXCwNP6TnY6NRF5gFDM4NU9KDlbtA6HG2dwhDVS0RYQGXwZW/mHbdf8fCnaw== +react-dev-utils@^12.0.1: + version "12.0.1" + resolved "https://registry.yarnpkg.com/react-dev-utils/-/react-dev-utils-12.0.1.tgz#ba92edb4a1f379bd46ccd6bcd4e7bc398df33e73" + integrity sha512-84Ivxmr17KjUupyqzFode6xKhjwuEJDROWKJy/BthkL7Wn6NJ8h4WE6k/exAv6ImS+0oZLRRW5j/aINMHyeGeQ== + dependencies: + "@babel/code-frame" "^7.16.0" + address "^1.1.2" + browserslist "^4.18.1" + chalk "^4.1.2" + cross-spawn "^7.0.3" + detect-port-alt "^1.1.6" + escape-string-regexp "^4.0.0" + filesize "^8.0.6" + find-up "^5.0.0" + fork-ts-checker-webpack-plugin "^6.5.0" + global-modules "^2.0.0" + globby "^11.0.4" + gzip-size "^6.0.0" + immer "^9.0.7" + is-root "^2.1.0" + loader-utils "^3.2.0" + open "^8.4.0" + pkg-up "^3.1.0" + prompts "^2.4.2" + react-error-overlay "^6.0.11" + recursive-readdir "^2.2.2" + shell-quote "^1.7.3" + strip-ansi "^6.0.1" + text-table "^0.2.0" react-div-100vh@*, react-div-100vh@^0.7.0: version "0.7.0"