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! { -""
} - } else { - match value.status { - 1 => { - view! { -- "มีคนใช้แล้ว" -
- } - } - 0 => { - view! {"ใช้ได้"
} - } - _ => { - view! { -- "เกิดข้อผิดพลาด" -
- } - } - } - } - }) - }) - }} +""
} + } else { + match value.status { + 1 => { + view! { ++ "มีคนใช้แล้ว" +
+ } + } + 0 => { + view! {"ใช้ได้"
} + } + _ => { + view! { ++ "เกิดข้อผิดพลาด" +
+ } + } + } + } + }) + }) + }} -"ใช้ไม่ได้"
} - } else if username.get() == new_username.get() { - view! {"ใช้ได้"
} - } else { - match value.status { - 1 => { - view! {"X"
} - } - 0 => { - view! {"ใช้ได้"
} - } - _ => { - view! { -- "เกิดข้อผิดพลาด" -
- } - } - } - } - }) - }) - }} +"ใช้ไม่ได้"
} + } else if username.get() == new_username.get() { + view! {"ใช้ได้"
} + } else { + match value.status { + 1 => { + view! {"X"
} + } + 0 => { + view! {"ใช้ได้"
} + } + _ => { + view! { ++ "เกิดข้อผิดพลาด" +
+ } + } + } + } + }) + }) + }} -