add sign-in page

This commit is contained in:
b1ek 2023-08-23 17:16:55 +10:00
parent 114503a5b6
commit 6195e50b07
Signed by: blek
GPG Key ID: 14546221E3595D0C
5 changed files with 41 additions and 2 deletions

View File

@ -3,6 +3,7 @@
import Load from './page/Load/Load.svelte';
import Greet from './page/Greet/Greet.svelte';
import SignIn from './page/SignIn/SignIn.svelte';
import Titlebar from './widget/Titlebar/Titlebar.svelte';
@ -38,6 +39,7 @@
<Router {url}>
<Route path='/' component={Greet} />
<Route path='/load' component={Load} />
<Route path='/sign-in' component={SignIn} />
</Router>
</div>
</div>

View File

@ -30,13 +30,13 @@
</button>
</Link>
<Link href='/homeserver_list'>
<Link href='/homeserver-list'>
<button>
Create account
</button>
</Link>
<br/>
<Link href='/homeserver_list'>
<Link href='/homeserver-list'>
<button>
Explore servers
</button>

View File

@ -0,0 +1,15 @@
<script lang="ts">
import style from './style.module.scss';
import AccountStore from '../../store/AccountStore';
let homeserver = AccountStore.getState().homeserver;
</script>
<div class={style.root}>
<h1>Log In</h1>
<p align='center'>
To continue, you must choose a homeserver<br/>
<input type='text' value={homeserver}>
</p>
</div>

View File

@ -0,0 +1,7 @@
.root {
h1 {
font-weight: 400;
font-size: 20pt;
text-align: center;
}
}

15
src/store/AccountStore.ts Normal file
View File

@ -0,0 +1,15 @@
import { configureStore } from '@reduxjs/toolkit';
export interface RouteState {
homeserver: string
}
export default configureStore({
reducer: {
homeserver: (state = 'matrix.org', action) => {
const actions = [ 'setHomeserver' ];
if (actions.indexOf(action.type) === -1) return state;
return action.homeserver ?? state;
}
},
})