Add isLoading to issue page

This commit is contained in:
Fred Boniface 2023-06-26 16:33:17 +01:00
parent 2b1478f685
commit 50f07bb32c
1 changed files with 7 additions and 0 deletions

View File

@ -3,8 +3,10 @@
import Island from "$lib/islands/island.svelte"; import Island from "$lib/islands/island.svelte";
import Nav from "$lib/navigation/nav.svelte"; import Nav from "$lib/navigation/nav.svelte";
import { onMount } from "svelte"; import { onMount } from "svelte";
import Loading from "$lib/navigation/loading.svelte";
const title = "Report Issue"; const title = "Report Issue";
let isLoading = false;
let reportType = "", reportSubject = "", reportMsg = "", reportCollected let reportType = "", reportSubject = "", reportMsg = "", reportCollected
onMount(async () => { onMount(async () => {
@ -26,6 +28,7 @@
async function send() { async function send() {
console.log("SEND DATA REQUESTED") console.log("SEND DATA REQUESTED")
isLoading = true
const formData = JSON.stringify({ const formData = JSON.stringify({
labels: [reportType], labels: [reportType],
subject: reportSubject, subject: reportSubject,
@ -53,6 +56,10 @@
</script> </script>
<Header {title} /> <Header {title} />
{#if isLoading}
<Loading />
{/if}
{#if !preFlight} {#if !preFlight}
<p>Any data that you enter here will be visible publicly <p>Any data that you enter here will be visible publicly
<a href="https://git.fjla.uk/OwlBoard/backend/issues" target="_blank">here</a> <a href="https://git.fjla.uk/OwlBoard/backend/issues" target="_blank">here</a>