🚸 notify user of submitted evaluation

Co-authored-by: haraldnilsen <harald_998@hotmail.com>
Signed-off-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
Sindre Kjelsrud 2024-01-14 16:22:59 +01:00
parent aabf00e3b3
commit 657f90002f
Signed by untrusted user who does not match committer: sidski
GPG key ID: D2BBDF3EDE6BA9A6

View file

@ -3,11 +3,12 @@
import { goto } from "$app/navigation";
let evaluationText:string = ""
let submittedEval: boolean = false
const handleEvaluationSubmit = async () => {
if (evaluationText) {
await postEvaluationData(evaluationText)
goto("/")
submittedEval = true
} else {
console.log("error");
}
@ -22,13 +23,24 @@
<p>Har du tid så setter vi veldig pris på om du skrevet en liten tilbakemelding til oss i tekstfeltet under:</p>
</div>
<div class="flex flex-col gap-12 md:gap-8 justify-center items-center">
<textarea bind:value={evaluationText} cols="30" rows="8" class="border-solid border-gray-400 border-2 p-3 md:text-l md:w-1/3 rounded-md" placeholder="Skriv evaluering her"></textarea>
<button
class="text-primary hover:bg-primary hover:text-bg font-bold border-primary border-2 rounded-full px-8 py-1"
on:click={handleEvaluationSubmit}
>
Send evaluering
{#if !submittedEval}
<div class="flex flex-col gap-12 md:gap-3 justify-center items-center">
<textarea bind:value={evaluationText} cols="30" rows="8" class="border-solid border-gray-400 border-2 p-3 md:text-l md:w-1/3 rounded-md" placeholder="Skriv evaluering her"></textarea>
<button
class="text-primary hover:bg-primary hover:text-bg font-bold border-primary border-2 rounded-full px-8 py-1"
on:click={handleEvaluationSubmit}
>
Send evaluering
</button>
</div>
{:else}
<div class="flex justify-center text-center">
<h1 class="text-xl text-primary font-semibold">Takk for tilbakemeldingen!</h1>
</div>
{/if}
<div class="flex flex-col justify-center items-center md:mt-8">
<button class="text-bg w-auto bg-primary hover:bg-bg hover:text-primary font-bold border-primary border-2 rounded-xl px-12 py-3" on:click={() => goto("/")}>
Returner til hjemmesiden
</button>
</div>
</div>