🚧 working on submit-functionality
Co-authored-by: haraldnilsen <harald_998@hotmail.com> Signed-off-by: Sindre Kjelsrud <kjelsrudsindre@gmail.com>
This commit is contained in:
parent
d92c45ecfc
commit
b732a46ca1
3 changed files with 14 additions and 8 deletions
|
|
@ -4,6 +4,7 @@
|
|||
import { goto } from "$app/navigation";
|
||||
|
||||
export let questionNum:number
|
||||
export let answeredAll:boolean
|
||||
|
||||
const gotoNextPage = async (questionNum: number) => {
|
||||
goto(`${questionNum + 1}`)
|
||||
|
|
@ -23,7 +24,7 @@
|
|||
class={`${questionNum == 0 || questionNum % 4 != 0 ? "hidden" : "bg-primary text-bg hover:bg-bg hover:text-primary"} font-bold uppercase border-primary border-2 rounded-full px-8 py-3`}>
|
||||
Send inn svar
|
||||
</button>
|
||||
<button disabled={questionNum != 0 && questionNum % 4 == 0} class={`flex items-center gap-2 text-primary font-semibold ${questionNum != 0 && questionNum % 4 == 0 && "opacity-50"}`} on:click={() => gotoNextPage(questionNum)}>
|
||||
<button disabled={(questionNum != 0 && questionNum % 4 == 0) || !answeredAll} class={`flex items-center gap-2 text-primary font-semibold ${questionNum != 0 && questionNum % 4 == 0 && "opacity-50"}`} on:click={() => gotoNextPage(questionNum)}>
|
||||
Neste spørsmål
|
||||
<ArrowChevron width=16 direction="right"/>
|
||||
</button>
|
||||
|
|
|
|||
Reference in a new issue