diff --git a/src/app/components/donate.rs b/src/app/components/donate.rs index 3048f7d..dff93f8 100644 --- a/src/app/components/donate.rs +++ b/src/app/components/donate.rs @@ -8,66 +8,71 @@ const LNURL: &str = "LNURL1DP68GURN8GHJ7EM9W3SKCCNE9E3K7MF0D3H82UNVWQHHVCT6WU7PK pub fn QrCodeCmp() -> impl IntoView { if leptos::leptos_dom::is_browser() { let svgs = view! {
}; - let result: String = qrcode_generator::to_svg_to_string(LNURL, QrCodeEcc::Medium, 256, None::<&str>).unwrap(); + let result: String = + qrcode_generator::to_svg_to_string(LNURL, QrCodeEcc::Medium, 256, None::<&str>) + .expect("QR Loaded"); svgs.set_inner_html(&result); svgs } else { view! {
} } - } #[component] pub fn Donate() -> impl IntoView { view! { -
- -
- -
- -
-
- - -
-
- - -
-
-
- } -} + "📋" + + +
+ + +
+ + + } +} diff --git a/src/app/components/footer.rs b/src/app/components/footer.rs index 3e75b9c..22a86af 100644 --- a/src/app/components/footer.rs +++ b/src/app/components/footer.rs @@ -33,32 +33,33 @@ pub fn Footer(dark_mode: RwSignal) -> impl IntoView { }; }; view! { - - } + + } } diff --git a/src/app/components/loading.rs b/src/app/components/loading.rs index 6d7f1c8..895ea4c 100644 --- a/src/app/components/loading.rs +++ b/src/app/components/loading.rs @@ -3,24 +3,24 @@ use leptos::*; #[component] pub fn LoadingIndi() -> impl IntoView { view! { -
- - Loading... -
- } +
+ + Loading... +
+ } } diff --git a/src/app/components/nav.rs b/src/app/components/nav.rs index b2cd295..7e2c1bf 100644 --- a/src/app/components/nav.rs +++ b/src/app/components/nav.rs @@ -3,92 +3,99 @@ use leptos::*; #[component] pub fn NavBar() -> impl IntoView { let onclick_menu = move |_| { - let menu = web_sys::window().unwrap().document().unwrap().get_element_by_id("mobile-menu").expect("element found"); + let menu = web_sys::window() + .unwrap() + .document() + .unwrap() + .get_element_by_id("mobile-menu") + .expect("element found"); let _ = menu.class_list().toggle("hidden"); }; view! { - + } } - diff --git a/src/app/components/nofusers.rs b/src/app/components/nofusers.rs index 4e9b949..c39ac1e 100644 --- a/src/app/components/nofusers.rs +++ b/src/app/components/nofusers.rs @@ -3,40 +3,42 @@ use leptos::*; #[component] pub fn UsersCount(count: RwSignal) -> impl IntoView { view! { -
- - - Loading... -
- } - }> - // handles the error from the resource - "เกิดข้อผิดพลาด"

} - }> - -
- - - } +
+ + + Loading... +
+ } + }}> + // handles the error from the resource + "เกิดข้อผิดพลาด"

+ } + }}> + +
+ + + } } diff --git a/src/app/components/register.rs b/src/app/components/register.rs index 855ed0b..5607f15 100644 --- a/src/app/components/register.rs +++ b/src/app/components/register.rs @@ -16,112 +16,112 @@ pub fn RegisterPage( ) -> impl IntoView { let user = create_resource(move || username.get(), check_username); view! { - -
- - "Loading..."
} - }> -
- - -
-
-
- - - - } +
+ + +
+ + + + + + + + + } } #[component] @@ -169,70 +169,70 @@ fn ButtonGood( }); }; view! { -
- - } - }> - // handles the error from the resource - "เกิดข้อผิดพลาด"

} - }> - {move || { - user_resouce - .clone() - .get() - .map(|view| { - view.map(|value| { - if username.get().is_empty() { - view! { - - } - } else { - match value.status { - 1 => { - view! { - - } - } - 0 => { - view! { - - } - } - _ => { - view! { - - } - } - } - } - }) - }) - }} +
+ } + }}> + // handles the error from the resource + "เกิดข้อผิดพลาด"

+ } + }}> + {move || { + user_resouce + .clone() + .get() + .map(|view| { + view.map(|value| { + if username.get().is_empty() { + view! { + + } + } else { + match value.status { + 1 => { + view! { + + } + } + 0 => { + view! { + + } + } + _ => { + view! { + + } + } + } + } + }) + }) + }} -
-
-
- } +
+
+
+ } } #[component] @@ -241,51 +241,51 @@ pub fn UserGood( user_resouce: Resource>, ) -> impl IntoView { view! { -
- - } - }> - // handles the error from the resource - "เกิดข้อผิดพลาด"

} - }> - {move || { - user_resouce - .clone() - .get() - .map(|view| { - view.map(|value| { - if username.get().is_empty() { - view! {

""

} - } else { - match value.status { - 1 => { - view! { -

- "มีคนใช้แล้ว" -

- } - } - 0 => { - view! {

"ใช้ได้"

} - } - _ => { - view! { -

- "เกิดข้อผิดพลาด" -

- } - } - } - } - }) - }) - }} +
+ } + }}> + // handles the error from the resource + "เกิดข้อผิดพลาด"

+ } + }}> + {move || { + user_resouce + .clone() + .get() + .map(|view| { + view.map(|value| { + if username.get().is_empty() { + view! {

""

} + } else { + match value.status { + 1 => { + view! { +

+ "มีคนใช้แล้ว" +

+ } + } + 0 => { + view! {

"ใช้ได้"

} + } + _ => { + view! { +

+ "เกิดข้อผิดพลาด" +

+ } + } + } + } + }) + }) + }} -
-
-
- } +
+
+
+ } } diff --git a/src/app/components/signin.rs b/src/app/components/signin.rs index 86ce22f..1b421c8 100644 --- a/src/app/components/signin.rs +++ b/src/app/components/signin.rs @@ -72,75 +72,75 @@ pub fn SignInPage() -> impl IntoView { }; view! { -
- - -
- -
- -
- -
- () - .unwrap_or("".to_string()); - pub_key.set(val); - } - /> +
+ + +
+ +
+ +
+ +
+ () + .unwrap_or("".to_string()); + pub_key.set(val); + }} + /> -
- -
- - } - }> - // handles the error from the resource - "เกิดข้อผิดพลาด"

} - }> - {move || { - view! { - - } - }} +
+ + + } + }}> + // handles the error from the resource + "เกิดข้อผิดพลาด"

+ } + }}> + {move || { + view! { + + } + }} -
-
-
- } + + +
+ } } #[component] @@ -167,64 +167,67 @@ fn ButtonGood( }; }; view! { -
- - } - }> - // handles the error from the resource - "เกิดข้อผิดพลาด"

} - }> - {move || { - if pub_key.get().is_empty() { - view! { - - } - } else { - match user_resouce.clone().get().expect("server respon") { - Ok(value) => { - match value.user { - Some(_) => { - view! { - - } - } - None => { - view! { - - } - } - } - } - Err(_) => { - view! { - - } - } - } - } - }} +
+ } + }}> + // handles the error from the resource + "เกิดข้อผิดพลาด"

+ } + }}> + {move || { + if pub_key.get().is_empty() { + view! { + + } + } else { + match user_resouce.clone().get().expect("server respon") { + Ok(value) => { + match value.user { + Some(_) => { + view! { + + } + } + None => { + view! { + + } + } + } + } + Err(_) => { + view! { + + } + } + } + } + }} -
-
-
- } +
+
+
+ } } #[component] diff --git a/src/app/components/user.rs b/src/app/components/user.rs index 03e6856..d165f77 100644 --- a/src/app/components/user.rs +++ b/src/app/components/user.rs @@ -17,114 +17,122 @@ pub fn UserPage( let new_username = create_rw_signal(usernamed); let user = create_resource(move || new_username.get(), check_username); view! { -
- -
- - "Loading..."
} - }> -
-
- } + "Delete" + + + + + + } } #[component] @@ -134,51 +142,51 @@ pub fn UserGood( user_resouce: Resource>, ) -> impl IntoView { view! { -
- - } - }> - // handles the error from the resource - "เกิดข้อผิดพลาด"

} - }> - {move || { - user_resouce - .clone() - .get() - .map(|view| { - view.map(|value| { - if new_username.get().is_empty() { - view! {

"ใช้ไม่ได้"

} - } else if username.get() == new_username.get() { - view! {

"ใช้ได้"

} - } else { - match value.status { - 1 => { - view! {

"X"

} - } - 0 => { - view! {

"ใช้ได้"

} - } - _ => { - view! { -

- "เกิดข้อผิดพลาด" -

- } - } - } - } - }) - }) - }} +
+ } + }}> + // handles the error from the resource + "เกิดข้อผิดพลาด"

+ } + }}> + {move || { + user_resouce + .clone() + .get() + .map(|view| { + view.map(|value| { + if new_username.get().is_empty() { + view! {

"ใช้ไม่ได้"

} + } else if username.get() == new_username.get() { + view! {

"ใช้ได้"

} + } else { + match value.status { + 1 => { + view! {

"X"

} + } + 0 => { + view! {

"ใช้ได้"

} + } + _ => { + view! { +

+ "เกิดข้อผิดพลาด" +

+ } + } + } + } + }) + }) + }} -
-
-
- } +
+
+
+ } } #[component] @@ -226,63 +234,61 @@ fn ButtonGood( }) }; view! { - - } - }> - // handles the error from the resource - "เกิดข้อผิดพลาด"

} - }> - {move || { - user_resouce - .clone() - .get() - .map(|view| { - view.map(|value| { - if new_username.get().is_empty() { - view! { - - } - } else if new_username.get() == username.get() { - view! { - - } - } else { - match value.status { - 1 => { - view! { - - } - } - 0 => { - view! { - - } - } - _ => { - view! { - - } - } - } - } - }) - }) - }} + } + }}> + // handles the error from the resource + "เกิดข้อผิดพลาด"

} + }}> + {move || { + user_resouce + .clone() + .get() + .map(|view| { + view.map(|value| { + if new_username.get().is_empty() { + view! { + + } + } else if new_username.get() == username.get() { + view! { + + } + } else { + match value.status { + 1 => { + view! { + + } + } + 0 => { + view! { + + } + } + _ => { + view! { + + } + } + } + } + }) + }) + }} -
-
- } +
+
+ } }