chore(deps): update rust dependencies
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
@@ -280,3 +280,35 @@ fn random_badge_color(seed: usize) -> String {
|
||||
|
||||
colors[seed % colors.len()].to_string()
|
||||
}
|
||||
|
||||
#[derive(PartialEq, Props, Clone)]
|
||||
pub struct AccessibleLinkProps {
|
||||
to: String,
|
||||
#[props(default = "".to_string())]
|
||||
class: String,
|
||||
#[props(default = false)]
|
||||
new_tab: bool,
|
||||
children: Element,
|
||||
}
|
||||
|
||||
#[component]
|
||||
pub fn AccessibleLink(props: AccessibleLinkProps) -> Element {
|
||||
let mut aria_label = String::new();
|
||||
let mut rel = String::new();
|
||||
|
||||
if props.new_tab {
|
||||
aria_label = t!("link_opens_new_tab").to_string();
|
||||
rel = "noopener noreferrer".to_string();
|
||||
}
|
||||
|
||||
rsx! {
|
||||
Link {
|
||||
to: "{props.to}",
|
||||
class: "{props.class}",
|
||||
new_tab: props.new_tab,
|
||||
rel: "{rel}",
|
||||
aria_label: "{aria_label}",
|
||||
{props.children}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -39,11 +39,11 @@ fn Introduction() -> Element {
|
||||
P {
|
||||
{ t!("cv_introduction_tools") },
|
||||
" ",
|
||||
Link { new_tab: true, to: "https://www.lazyvim.org/", "NeoVim (LazyVim)" },
|
||||
AccessibleLink { new_tab: true, to: "https://www.lazyvim.org/", "NeoVim (LazyVim)" },
|
||||
", ",
|
||||
Link { new_tab: true, to: "https://zellij.dev/", "Zellij" },
|
||||
AccessibleLink { new_tab: true, to: "https://zellij.dev/", "Zellij" },
|
||||
", ",
|
||||
Link { new_tab: true, to: "https://k9scli.io/", "k9s" }
|
||||
AccessibleLink { new_tab: true, to: "https://k9scli.io/", "k9s" }
|
||||
},
|
||||
},
|
||||
}
|
||||
@@ -210,7 +210,7 @@ fn Socials() -> Element {
|
||||
H4 { { t!("cv_socials_title") } },
|
||||
div {
|
||||
class: "flex justify-center items-center space-x-4",
|
||||
P { Link { to:"https://www.linkedin.com/in/tudattr/", class:"hover:underline", new_tab: true, img { class: "h-8", src:asset!("./assets/pictures/LI-Bug.svg.original.svg"), alt:"LinkedIn Logo" } }},
|
||||
P { AccessibleLink { to:"https://www.linkedin.com/in/tudattr/", class:"hover:underline", new_tab: true, img { class: "h-8", src:asset!("./assets/pictures/LI-Bug.svg.original.svg"), alt:"LinkedIn Logo" } }},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
use crate::components::{Card, P};
|
||||
use crate::components::{AccessibleLink, Card, P};
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_i18n::t;
|
||||
|
||||
@@ -20,9 +20,10 @@ pub fn Home() -> Element {
|
||||
}
|
||||
},
|
||||
},
|
||||
Link {
|
||||
AccessibleLink {
|
||||
to: "mailto:tuan-dat.tran@tudattr.dev",
|
||||
class: "text-gray-900 bg-gradient-to-br from-green-400 to-blue-600 group-hover:from-green-400 group-hover:to-blue-600 hover:text-white rounded-full shadow-lg py-4 px-4",
|
||||
new_tab: true,
|
||||
{ t!("home_card_contact_button") }
|
||||
}
|
||||
},
|
||||
|
||||
20
src/main.rs
20
src/main.rs
@@ -9,7 +9,8 @@ use dioxus_i18n::prelude::Locale;
|
||||
use dioxus_i18n::unic_langid::langid;
|
||||
use layout::footer::Footer;
|
||||
use layout::header::Header;
|
||||
use tracing::Level;
|
||||
use tracing::{Level, info};
|
||||
use tracing_subscriber::{fmt, prelude::*, EnvFilter};
|
||||
|
||||
pub mod components;
|
||||
mod cv;
|
||||
@@ -35,14 +36,27 @@ pub enum Route {
|
||||
PublicationsProjects {},
|
||||
#[route("/resume")]
|
||||
CV {},
|
||||
#[route("/health")]
|
||||
Health {},
|
||||
#[end_layout]
|
||||
#[route("/:..route")]
|
||||
PageNotFound { route: Vec<String> },
|
||||
}
|
||||
|
||||
fn main() {
|
||||
dioxus_logger::init(Level::DEBUG).expect("failed to init logger");
|
||||
LaunchBuilder::new().launch(App)
|
||||
// Configure tracing to output JSON logs
|
||||
tracing_subscriber::registry()
|
||||
.with(EnvFilter::from_default_env().add_directive(Level::INFO.into()))
|
||||
.with(fmt::layer().json())
|
||||
.init();
|
||||
|
||||
info!("Starting Dioxus application...");
|
||||
LaunchBuilder::new().launch(App);
|
||||
}
|
||||
|
||||
#[component]
|
||||
fn Health() -> Element {
|
||||
rsx! { "OK" }
|
||||
}
|
||||
|
||||
fn App() -> Element {
|
||||
|
||||
Reference in New Issue
Block a user