chore(dioxus): Upgraded to dioxus 0.6.0
Signed-off-by: Tuan-Dat Tran <tuan-dat.tran@tudattr.dev>
This commit is contained in:
33
src/main.rs
33
src/main.rs
@@ -1,11 +1,12 @@
|
||||
#![allow(non_snake_case)]
|
||||
|
||||
use std::str::FromStr;
|
||||
|
||||
use components::H1;
|
||||
use dioxus::prelude::*;
|
||||
use dioxus_sdk::i18n::*;
|
||||
|
||||
use dioxus_i18n::prelude::use_init_i18n;
|
||||
use dioxus_i18n::prelude::I18nConfig;
|
||||
use dioxus_i18n::prelude::Locale;
|
||||
use dioxus_i18n::unic_langid::langid;
|
||||
use layout::footer::Footer;
|
||||
use layout::header::Header;
|
||||
use tracing::Level;
|
||||
@@ -14,15 +15,12 @@ pub mod components;
|
||||
mod cv;
|
||||
mod home;
|
||||
mod impressum;
|
||||
mod languages;
|
||||
mod layout;
|
||||
mod publications;
|
||||
|
||||
use crate::cv::CV;
|
||||
use crate::home::Home;
|
||||
use crate::impressum::Impressum;
|
||||
use crate::languages::DE_DE;
|
||||
use crate::languages::EN_GB;
|
||||
use crate::layout::Layout;
|
||||
use crate::publications::PublicationsProjects;
|
||||
|
||||
@@ -44,21 +42,26 @@ pub enum Route {
|
||||
|
||||
fn main() {
|
||||
dioxus_logger::init(Level::DEBUG).expect("failed to init logger");
|
||||
LaunchBuilder::fullstack()
|
||||
.with_cfg(server_only!(dioxus::fullstack::Config::new().addr(
|
||||
std::net::SocketAddrV4::new(std::net::Ipv4Addr::new(0, 0, 0, 0), 8080,)
|
||||
)))
|
||||
.launch(App)
|
||||
LaunchBuilder::new().launch(App)
|
||||
}
|
||||
|
||||
fn App() -> Element {
|
||||
use_init_i18n("en-GB".parse().unwrap(), "en-GB".parse().unwrap(), || {
|
||||
let en_gb = Language::from_str(EN_GB).unwrap();
|
||||
let de_de = Language::from_str(DE_DE).unwrap();
|
||||
vec![en_gb, de_de]
|
||||
use_init_i18n(|| {
|
||||
I18nConfig::new(langid!("en-GB"))
|
||||
.with_locale(Locale::new_static(
|
||||
langid!("en-GB"),
|
||||
include_str!("./languages/en-GB.ftl"),
|
||||
))
|
||||
.with_locale(Locale::new_static(
|
||||
langid!("de-DE"),
|
||||
include_str!("./languages/de-DE.ftl"),
|
||||
))
|
||||
});
|
||||
|
||||
rsx! {
|
||||
document::Link { rel: "stylesheet", href: asset!("./assets/tailwind.css") }
|
||||
document::Link { rel: "icon", href: asset!("./assets/favicon.ico") }
|
||||
// <link rel="icon" type="image/x-icon" href="/images/favicon.ico">
|
||||
meta {
|
||||
name: "description",
|
||||
content: "Visit Tuan-Dat Tran's website for his CV, publications, projects, and consulting services. Connect for collaboration.",
|
||||
|
||||
Reference in New Issue
Block a user