Last active
April 19, 2023 04:11
-
-
Save Enigo/eccf6cae43b7ae55ee9b036bb48d2090 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use crate::view::home::Home; | |
use yew::prelude::*; | |
use yew_router::prelude::*; | |
#[derive(Clone, Routable, PartialEq)] | |
pub enum Route { | |
#[at("/:token_address")] | |
Collection { token_address: String }, | |
#[at("/")] | |
Home, | |
#[not_found] | |
#[at("/404")] | |
NotFound, | |
} | |
pub fn switch(route: Route) -> Html { | |
match route { | |
Route::Home => html! { <Home />}, | |
Route::Collection { token_address } => html! { <p class="text-white">{ token_address }</p> }, | |
Route::NotFound => html! { <p class="text-white">{ "Not found" }</p> }, | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment