🚸 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:
parent
aabf00e3b3
commit
657f90002f
1 changed files with 20 additions and 8 deletions
|
@ -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,7 +23,8 @@
|
|||
<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">
|
||||
{#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"
|
||||
|
@ -31,5 +33,15 @@
|
|||
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>
|
||||
</div>
|
Reference in a new issue