🚸 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";
|
import { goto } from "$app/navigation";
|
||||||
|
|
||||||
let evaluationText:string = ""
|
let evaluationText:string = ""
|
||||||
|
let submittedEval: boolean = false
|
||||||
|
|
||||||
const handleEvaluationSubmit = async () => {
|
const handleEvaluationSubmit = async () => {
|
||||||
if (evaluationText) {
|
if (evaluationText) {
|
||||||
await postEvaluationData(evaluationText)
|
await postEvaluationData(evaluationText)
|
||||||
goto("/")
|
submittedEval = true
|
||||||
} else {
|
} else {
|
||||||
console.log("error");
|
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>
|
<p>Har du tid så setter vi veldig pris på om du skrevet en liten tilbakemelding til oss i tekstfeltet under:</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="flex flex-col gap-12 md:gap-8 justify-center items-center">
|
{#if !submittedEval}
|
||||||
<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>
|
<div class="flex flex-col gap-12 md:gap-3 justify-center items-center">
|
||||||
<button
|
<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>
|
||||||
class="text-primary hover:bg-primary hover:text-bg font-bold border-primary border-2 rounded-full px-8 py-1"
|
<button
|
||||||
on:click={handleEvaluationSubmit}
|
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
|
>
|
||||||
|
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>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
Reference in a new issue