Improvements
More styling
This commit is contained in:
@@ -333,32 +333,34 @@ pub fn login_component() -> Html {
|
||||
};
|
||||
|
||||
html! {
|
||||
<div class="form-container">
|
||||
<div class="page-header">
|
||||
<h1>{ "Login" }</h1>
|
||||
<main class="content">
|
||||
<div class="form-container">
|
||||
<div class="page-header">
|
||||
<h1>{ "Login" }</h1>
|
||||
</div>
|
||||
<form {onsubmit}>
|
||||
<input
|
||||
placeholder="username"
|
||||
value={(*username).clone()}
|
||||
oninput={Callback::from(move |e: InputEvent| {
|
||||
let input: web_sys::HtmlInputElement = e.target_unchecked_into();
|
||||
username.set(input.value());
|
||||
})}
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
placeholder="password"
|
||||
value={(*pwd).clone()}
|
||||
oninput={Callback::from(move |e: InputEvent| {
|
||||
let input: web_sys::HtmlInputElement = e.target_unchecked_into();
|
||||
pwd.set(input.value());
|
||||
})}
|
||||
/>
|
||||
<button type="submit" disabled={*loading}>{ if *loading { "Logging in..." } else { "Login" } }</button>
|
||||
if !error.is_empty() { <p class="alert error">{(*error).clone()}</p> }
|
||||
</form>
|
||||
</div>
|
||||
<form {onsubmit}>
|
||||
<input
|
||||
placeholder="username"
|
||||
value={(*username).clone()}
|
||||
oninput={Callback::from(move |e: InputEvent| {
|
||||
let input: web_sys::HtmlInputElement = e.target_unchecked_into();
|
||||
username.set(input.value());
|
||||
})}
|
||||
/>
|
||||
<input
|
||||
type="password"
|
||||
placeholder="password"
|
||||
value={(*pwd).clone()}
|
||||
oninput={Callback::from(move |e: InputEvent| {
|
||||
let input: web_sys::HtmlInputElement = e.target_unchecked_into();
|
||||
pwd.set(input.value());
|
||||
})}
|
||||
/>
|
||||
<button type="submit" disabled={*loading}>{ if *loading { "Logging in..." } else { "Login" } }</button>
|
||||
if !error.is_empty() { <p class="alert error">{(*error).clone()}</p> }
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
}
|
||||
}
|
||||
|
||||
@@ -450,10 +452,10 @@ pub fn all_users_component() -> Html {
|
||||
<div class="page-header">
|
||||
<h1>{ "All Users" }</h1>
|
||||
</div>
|
||||
<ul>
|
||||
<ul class="user-list">
|
||||
{ for users.iter().map(|t| html! {
|
||||
<li key={t.id.to_string()}>
|
||||
<Link<crate::Route> to={crate::Route::UserByID{id: t.id}}><h3>{ format!("{} {}- #{}", t.first_name, t.last_name, t.id) }</h3></Link<crate::Route>>
|
||||
<Link<crate::Route> to={crate::Route::UserByID{id: t.id}}><h3>{ format!("{} {}", t.first_name, t.last_name) }</h3></Link<crate::Route>>
|
||||
</li>
|
||||
})}
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user