Compare commits
2 commits
40090f7d98
...
cafac264a7
Author | SHA1 | Date | |
---|---|---|---|
|
cafac264a7 | ||
|
afa265cdfc |
3 changed files with 18 additions and 9 deletions
8
Cargo.lock
generated
8
Cargo.lock
generated
|
@ -2326,9 +2326,9 @@ checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d"
|
|||
|
||||
[[package]]
|
||||
name = "version_check"
|
||||
version = "0.9.4"
|
||||
version = "0.9.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f"
|
||||
checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a"
|
||||
|
||||
[[package]]
|
||||
name = "walkdir"
|
||||
|
@ -2575,9 +2575,9 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "xxhash-rust"
|
||||
version = "0.8.11"
|
||||
version = "0.8.12"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "63658493314859b4dfdf3fb8c1defd61587839def09582db50b8a4e93afca6bb"
|
||||
checksum = "6a5cbf750400958819fb6178eaa83bee5cd9c29a26a40cc241df8c70fdd46984"
|
||||
|
||||
[[package]]
|
||||
name = "yansi"
|
||||
|
|
|
@ -7,7 +7,7 @@ use serde_json::to_string;
|
|||
#[component]
|
||||
pub fn Auth() -> impl IntoView {
|
||||
let websocket = expect_context::<WebSocketContext>();
|
||||
let (username, _set_username) = create_signal("Anonymous");
|
||||
let (username, set_username) = create_signal("Anonymous".to_string());
|
||||
|
||||
let username_input_ref = create_node_ref::<Input>();
|
||||
let send_login = move |_| {
|
||||
|
@ -17,6 +17,8 @@ pub fn Auth() -> impl IntoView {
|
|||
})
|
||||
.unwrap(),
|
||||
);
|
||||
set_username.set(username_input_ref.get().unwrap().value());
|
||||
username_input_ref.get().unwrap().set_value("");
|
||||
logging::log!("sent");
|
||||
};
|
||||
|
||||
|
@ -24,18 +26,22 @@ pub fn Auth() -> impl IntoView {
|
|||
<div class="p-1">
|
||||
<h2 class="text-2xl">Sign in:</h2>
|
||||
<p>Username:</p>
|
||||
<form
|
||||
onsubmit="return false"
|
||||
on:submit=send_login
|
||||
>
|
||||
<input
|
||||
class="w-96 font-mono rounded-sm bg-slate-900 text-slate-200"
|
||||
placeholder=move || username.get()
|
||||
node_ref=username_input_ref
|
||||
on:change=send_login.clone()
|
||||
/>
|
||||
<br />
|
||||
<input
|
||||
class="py-2 px-4 pl-4 font-bold text-white rounded border-b-4 bg-slate-600 border-slate-800 hover:bg-slate-700 hover:border-slate-500"
|
||||
type="submit"
|
||||
value="Send"
|
||||
on:change=send_login.clone()
|
||||
/>
|
||||
</form>
|
||||
</div>
|
||||
}
|
||||
}
|
||||
|
|
|
@ -84,18 +84,21 @@ pub fn Chat() -> impl IntoView {
|
|||
</textarea>
|
||||
<br/>
|
||||
<span>
|
||||
<form
|
||||
onsubmit="return false"
|
||||
on:submit=send_message
|
||||
>
|
||||
<input
|
||||
class="w-80 h-11 font-mono rounded-sm bg-slate-900 text-slate-200"
|
||||
placeholder="talk shit..."
|
||||
node_ref=chat_input_ref
|
||||
on:change=send_message.clone()
|
||||
/>
|
||||
<input
|
||||
class="py-2 px-4 pl-4 font-bold text-white rounded border-b-4 bg-slate-600 border-slate-800 hover:bg-slate-700 hover:border-slate-500"
|
||||
type="submit"
|
||||
value="Send"
|
||||
on:change=send_message.clone()
|
||||
/>
|
||||
</form>
|
||||
</span>
|
||||
<br/>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Reference in a new issue