add more info to offline network check
Some checks failed
Deploy Backend / deploy (push) Has been cancelled
Deploy Website / deploy (push) Successful in 5m32s

This commit is contained in:
Lee 2024-10-19 07:52:19 +01:00
parent 0931e52df5
commit 4eb96da1f1
3 changed files with 13 additions and 5 deletions

View File

@ -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 }}

View File

@ -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 />

View File

@ -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
);