Format frontend

This commit is contained in:
Adria Navarro 2024-01-08 10:46:14 +01:00
parent a472e47b22
commit b115ead329
1 changed files with 18 additions and 22 deletions

View File

@ -1,10 +1,9 @@
<script> <script>
import Spinner from "components/common/Spinner.svelte"
import { redirect, params } from "@roxi/routify" import { redirect, params } from "@roxi/routify"
import { API } from "api" import { API } from "api"
const timeoutMs = 60000 // 1 minute const timeoutMs = 180000 // 3 minutes
const loadTime = Date.now() const loadTime = Date.now()
let timedOut = false let timedOut = false
@ -31,39 +30,36 @@
function migrationTimeout() { function migrationTimeout() {
timedOut = true timedOut = true
} }
$: text = !timedOut ? "System update" : "Something went wrong!"
$: subtext = !timedOut
? "Please wait and we will be back in a second!"
: "An error occurred, please try again later"
</script> </script>
<div class="loading"> <div class="loading" class:timeout={timedOut}>
{#if !timedOut} <span class="header">{text}</span>
<p class="loading-message"> <span class="subtext">{subtext}</span>
🛠️ We are updating the system. <br />Please wait, we will be back in a
second!
</p>
<Spinner size="20" />
{:else}
<p class="loading-message timeout">
An error occurred. Please try again later.
</p>
{/if}
</div> </div>
<style> <style>
.loading { .loading {
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center;
justify-content: center;
flex-direction: column; flex-direction: column;
gap: var(--spacing-xl); gap: var(--spacing-l);
height: 100vh; height: 100vh;
margin: 0;
}
.loading-message {
text-align: center; text-align: center;
font-size: 18px; font-size: 18px;
} }
.timeout { .header {
font-weight: 700;
}
.timeout .header {
color: rgb(196, 46, 46); color: rgb(196, 46, 46);
} }
.subtext {
font-size: 16px;
color: var(--grey-7);
}
</style> </style>