Refactor imports, cleaner now
This commit is contained in:
parent
ad51c3b664
commit
18224d3410
16
src/app.rs
16
src/app.rs
@ -1,5 +1,5 @@
|
||||
use crate::routes::whymdc::page::WhyMicroDatacentersProps;
|
||||
use crate::routes::whymdc::page::WhyMicroDatacenters;
|
||||
use crate::routes::whymdc::*;
|
||||
use crate::routes::home::*;
|
||||
use leptos::*;
|
||||
use leptos_meta::*;
|
||||
use leptos_router::*;
|
||||
@ -31,15 +31,3 @@ pub fn App(cx: Scope) -> impl IntoView {
|
||||
}
|
||||
}
|
||||
|
||||
/// Renders the home page of your application.
|
||||
#[component]
|
||||
fn HomePage(cx: Scope) -> impl IntoView {
|
||||
// Creates a reactive value to update the button
|
||||
let (count, set_count) = create_signal(cx, 0);
|
||||
let on_click = move |_| set_count.update(|count| *count += 1);
|
||||
|
||||
view! { cx,
|
||||
<h1 class="text-9xl">"Welcome to Nationtech.io!"</h1>
|
||||
<button on:click=on_click>"Click Me: " {count}</button>
|
||||
}
|
||||
}
|
||||
|
||||
2
src/routes/home/mod.rs
Normal file
2
src/routes/home/mod.rs
Normal file
@ -0,0 +1,2 @@
|
||||
mod page;
|
||||
pub use page::*;
|
||||
14
src/routes/home/page.rs
Normal file
14
src/routes/home/page.rs
Normal file
@ -0,0 +1,14 @@
|
||||
use leptos::*;
|
||||
|
||||
/// Renders the home page of your application.
|
||||
#[component]
|
||||
pub fn HomePage(cx: Scope) -> impl IntoView {
|
||||
// Creates a reactive value to update the button
|
||||
let (count, set_count) = create_signal(cx, 0);
|
||||
let on_click = move |_| set_count.update(|count| *count += 1);
|
||||
|
||||
view! { cx,
|
||||
<h1 class="text-9xl">"Welcome to Nationtech.io! Through proper import paths"</h1>
|
||||
<button on:click=on_click>"Click Me: " {count}</button>
|
||||
}
|
||||
}
|
||||
@ -1 +1,2 @@
|
||||
pub mod whymdc;
|
||||
pub mod home;
|
||||
|
||||
@ -1,2 +1,4 @@
|
||||
pub mod page;
|
||||
pub mod components;
|
||||
mod page;
|
||||
pub use page::*;
|
||||
|
||||
mod components;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user