diff --git a/Cargo.toml b/Cargo.toml
index a3dafd1..fda9f70 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -12,6 +12,7 @@ categories = ["gui", "wasm", "web-programming"]
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
yew = { version="0.21", features=["csr"] }
+yew-router = "0.18"
web-sys = { version = "0.3", features = ["Document", "HtmlElement", "Window"] }
gloo-utils = "0.1"
gloo-storage = "0.2"
diff --git a/src/app.rs b/src/app.rs
index 3c91001..18b3bc0 100644
--- a/src/app.rs
+++ b/src/app.rs
@@ -1,7 +1,9 @@
use yew::prelude::*;
+use yew_router::prelude::*;
use gloo_utils::document;
use gloo_storage::{LocalStorage, Storage};
use serde::{Deserialize, Serialize};
+use crate::home::HomePage;
use crate::kanban::KanbanBoard;
#[derive(Debug, PartialEq, Clone, Copy, Serialize, Deserialize)]
@@ -19,6 +21,25 @@ impl Theme {
}
}
+#[derive(Clone, Routable, PartialEq)]
+enum Route {
+ #[at("/")]
+ Home,
+ #[at("/kanban")]
+ Kanban,
+ #[not_found]
+ #[at("/404")]
+ NotFound,
+}
+
+fn switch(routes: Route) -> Html {
+ match routes {
+ Route::Home => html! {