break out auth
This commit is contained in:
parent
b88ecb29c0
commit
bba515cd1d
4 changed files with 20 additions and 17 deletions
17
client/src/components/auth.rs
Normal file
17
client/src/components/auth.rs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
use leptos::*;
|
||||||
|
|
||||||
|
#[component]
|
||||||
|
pub fn Auth() -> impl IntoView {
|
||||||
|
let (username, _set_username) = create_signal("Anonymous");
|
||||||
|
|
||||||
|
view! {
|
||||||
|
<div class="p-1">
|
||||||
|
<h2 class="text-2xl">Sign in:</h2>
|
||||||
|
<p>Username:</p>
|
||||||
|
<input
|
||||||
|
class="w-96 font-mono rounded-sm bg-slate-900 text-slate-200"
|
||||||
|
placeholder=move || username.get()
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,2 +1,3 @@
|
||||||
|
pub mod auth;
|
||||||
pub mod chat;
|
pub mod chat;
|
||||||
pub mod websocket;
|
pub mod websocket;
|
||||||
|
|
|
@ -128,19 +128,3 @@ pub fn Websocket() -> impl IntoView {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[component]
|
|
||||||
pub fn Auth() -> impl IntoView {
|
|
||||||
let (username, _set_username) = create_signal("Anonymous");
|
|
||||||
|
|
||||||
view! {
|
|
||||||
<div class="p-1">
|
|
||||||
<h2 class="text-2xl">Sign in:</h2>
|
|
||||||
<p>Username:</p>
|
|
||||||
<input
|
|
||||||
class="w-96 font-mono rounded-sm bg-slate-900 text-slate-200"
|
|
||||||
placeholder=move || username.get()
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
use crate::components::websocket::*;
|
use crate::components::auth::*;
|
||||||
use crate::components::chat::*;
|
use crate::components::chat::*;
|
||||||
|
use crate::components::websocket::*;
|
||||||
use leptos::*;
|
use leptos::*;
|
||||||
|
|
||||||
/// Default Home Page
|
/// Default Home Page
|
||||||
|
|
Loading…
Add table
Reference in a new issue