add more info to offline network check
This commit is contained in:
parent
0931e52df5
commit
4eb96da1f1
@ -59,7 +59,6 @@ jobs:
|
||||
.gitea/kubernetes/backend/deployment.yaml
|
||||
.gitea/kubernetes/backend/service.yaml
|
||||
.gitea/kubernetes/backend/strip-api-prefix-middleware.yaml
|
||||
.gitea/kubernetes/backend/strip-swagger-prefix-middleware.yaml
|
||||
.gitea/kubernetes/backend/ingress.yaml
|
||||
images: |
|
||||
git.fascinated.cc/fascinated/scoresaber-reloaded-backend:${{ github.sha }}
|
||||
|
@ -1,7 +1,8 @@
|
||||
import { ReactNode } from "react";
|
||||
import ScoreSaberLogo from "../logos/scoresaber-logo";
|
||||
|
||||
type Props = {
|
||||
reason: string;
|
||||
reason: string | ReactNode;
|
||||
};
|
||||
|
||||
export default function FullscreenLoader({ reason }: Props) {
|
||||
@ -9,7 +10,7 @@ export default function FullscreenLoader({ reason }: Props) {
|
||||
<div className="absolute w-screen h-screen bg-background brightness-75 flex flex-col gap-6 items-center justify-center">
|
||||
<div className="flex flex-col items-center justify-center">
|
||||
<p className="text-white text-xl font-bold">ScoreSaber Reloaded</p>
|
||||
<p className="text-gray-300 text-md">{reason}</p>
|
||||
<p className="text-gray-300 text-md text-center">{reason}</p>
|
||||
</div>
|
||||
<div className="animate-spin">
|
||||
<ScoreSaberLogo />
|
||||
|
@ -2,16 +2,24 @@
|
||||
|
||||
import FullscreenLoader from "@/components/loaders/fullscreen-loader";
|
||||
import { useNetworkState } from "@uidotdev/usehooks";
|
||||
import { ReactNode } from "react";
|
||||
|
||||
type Props = {
|
||||
children: React.ReactNode;
|
||||
children: ReactNode;
|
||||
};
|
||||
|
||||
export default function OfflineNetwork({ children }: Props) {
|
||||
const network = useNetworkState();
|
||||
|
||||
return !network.online ? (
|
||||
<FullscreenLoader reason="Your device is offline. Check your internet connection." />
|
||||
<FullscreenLoader
|
||||
reason={
|
||||
<>
|
||||
<p>Your device is offline. Check your internet connection.</p>
|
||||
<p>Connection Type: {network.type}</p>
|
||||
</>
|
||||
}
|
||||
/>
|
||||
) : (
|
||||
children
|
||||
);
|
||||
|
Reference in New Issue
Block a user