-
Notifications
You must be signed in to change notification settings - Fork 3
/
about.rs
76 lines (72 loc) · 2.8 KB
/
about.rs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
use crate::api;
use crate::auth::User;
use crate::ui::*;
use crate::{get_head, Context, Page};
use dioxus::prelude::*;
#[component]
pub fn AboutPage(mut context: Context) -> Element {
let authed_image_url: Resource<Result<String, reqwest::Error>> = use_resource(move || {
api::get_authed_image(
context
.supabase_client
.read()
.clone()
.user
.unwrap_or(User::default())
.bearer_token
.clone(),
"images/t5.png".to_string(),
)
});
let public_image_url = format!(
"{}/storage/v1/object/public/public-images/t5.png",
dotenv!("SUPABASE_URL").to_string()
);
rsx! {
{get_head()},
body {
div { class: "flex flex-col items-center h-screen bg-gray-900 text-white py-20",
h1 { class: "text-4xl mb-8 font-bold", "About T5 ⚙️" }
div { class: "flex flex-row justify-center items-center gap-5 mb-8",
div { class: "flex flex-col items-center gap-3",
i { "Public Image" }
img { class: "w-32 h-32", src: public_image_url }
}
match &*authed_image_url.read_unchecked() {
Some(Ok(url)) => {
rsx! {
div { class: "flex flex-col items-center gap-3",
i { "Authed Image" }
img {
class: "w-32 h-32",
src: {
format!(
"{}/storage/v1{}",
dotenv!("SUPABASE_URL").to_string(),
&url
)
}
}
}
}
}
_ =>{
rsx!{}
}
}
}
p { class: "text-center px-10",
"An opinionated cross-platform full-stack application template developed with Rust, Cargo Mobile 2, Dioxus, Warp, Diesel, PostgreSQL, Supabase Auth, Bun and TailwindCSS."
}
TextButton {
text: "Home Page",
onclick: move |_| {
context.page_provider.set(Page::Home);
},
class: "mt-6",
variant: Variant::Neutral
}
}
}
}
}