feat(web): mock register page

doesnt work yet but its a work in progress
This commit is contained in:
əlemi 2024-05-13 04:02:43 +02:00
parent 672ff178c7
commit eaf780efb3
Signed by: alemi
GPG key ID: A4895B84D311642C
4 changed files with 61 additions and 4 deletions

View file

@ -234,7 +234,8 @@
code.cw { code.cw {
display: block; display: block;
} }
input[type="submit"].active { input[type=button]:hover,
input[type=submit].active {
background-color: var(--accent); background-color: var(--accent);
border-color: var(--accent); border-color: var(--accent);
color: var(--background); color: var(--background);

View file

@ -118,6 +118,7 @@ pub fn App() -> impl IntoView {
<Route path="/web/objects/:id" view=move || view! { <ObjectPage tl=context_tl /> } /> <Route path="/web/objects/:id" view=move || view! { <ObjectPage tl=context_tl /> } />
<Route path="/web/search" view=SearchPage /> <Route path="/web/search" view=SearchPage />
<Route path="/web/register" view=RegisterPage />
<Route path="/" view=move || view! { <Redirect path="/web" /> } /> <Route path="/" view=move || view! { <Redirect path="/web" /> } />
</Routes> </Routes>

View file

@ -80,9 +80,18 @@ pub fn LoginBox(
}); });
}); });
} > } >
<input class="w-100" type="text" node_ref=username_ref placeholder="username" /> <table class="w-100 align">
<input class="w-100" type="password" node_ref=password_ref placeholder="password" /> <tr>
<input class="w-100" type="submit" value="login" /> <td colspan="2"><input class="w-100" type="text" node_ref=username_ref placeholder="username" /></td>
</tr>
<tr>
<td colspan="2"><input class="w-100" type="password" node_ref=password_ref placeholder="password" /></td>
</tr>
<tr>
<td class="w-50"><input class="w-100" type="submit" value="login" /></td>
<td class="w-50"><a href="/web/register"><input class="w-100" type="button" value="register" /></a></td>
</tr>
</table>
</form> </form>
</div> </div>
</div> </div>

View file

@ -23,6 +23,52 @@ pub fn AboutPage() -> impl IntoView {
} }
} }
#[component]
pub fn RegisterPage() -> impl IntoView {
view! {
<div>
<Breadcrumb>register</Breadcrumb>
<form>
<table class="align ma-3">
<tr>
<td>username</td>
<td><input type="email" /></td>
</tr>
<tr>
<td>password</td>
<td><input type="password" /></td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td>display name</td>
<td><input type="text" /></td>
</tr>
<tr>
<td>summary</td>
<td><input type="text" /></td>
</tr>
<tr>
<td>avatar url</td>
<td><input type="text" /></td>
</tr>
<tr>
<td>banner url</td>
<td><input type="text" /></td>
</tr>
<tr>
<td colspan="2"><hr /></td>
</tr>
<tr>
<td colspan="2"><input class="w-100" type="submit" value="register" /></td>
</tr>
</table>
</form>
</div>
}
}
#[component] #[component]
pub fn ConfigPage(setter: WriteSignal<Config>) -> impl IntoView { pub fn ConfigPage(setter: WriteSignal<Config>) -> impl IntoView {
let config = use_context::<Signal<Config>>().expect("missing config context"); let config = use_context::<Signal<Config>>().expect("missing config context");