Implemented routing instead of internal state
All checks were successful
/ Build the server (push) Successful in 3m5s

This commit is contained in:
2023-10-24 12:50:04 +02:00
parent 7334bd8e71
commit c8b2ae30c8
18 changed files with 135 additions and 121 deletions

View File

@@ -1,7 +1,8 @@
<script lang="ts">
import {Button, ButtonGroup, Card, Input, InputAddon} from 'flowbite-svelte';
import {Email, Password} from '../icons';
import {changeStateFunction, error_banner, info_banner, rpc, state, StateE, workingWrapperO} from '../store';
import {error_banner, info_banner, rpc, workingWrapperO} from '../store';
import {replace} from 'svelte-spa-router';
let username = '', username2 = '', password = '', password2 = '';
@@ -20,7 +21,7 @@
if (resp) {
info_banner.set('Account created, please wait till an administrator approves it');
$state.s = StateE.LOGIN;
await replace('/login');
}
}
@@ -48,7 +49,7 @@
<Input type="password" placeholder="Repeat password" bind:value={password2} on:keyup={keyUp}></Input>
</ButtonGroup>
<ButtonGroup class="w-full flex flex-nowrap">
<Button class="flex-1 flex-grow" color="primary" outline on:click={changeStateFunction(StateE.LOGIN)}>Login</Button>
<Button class="flex-1 flex-grow" color="primary" outline href="#/login">Login</Button>
<Button class="flex-1 flex-grow" color="primary" on:click={signup}>Singup</Button>
</ButtonGroup>
</Card>