diff --git a/leptos_components/.gitignore b/leptos_components/.gitignore new file mode 100644 index 0000000..5af6d1a --- /dev/null +++ b/leptos_components/.gitignore @@ -0,0 +1,15 @@ +# Generated by Cargo +# will have compiled files and executables +debug/ +target/ +node_modules/ + +# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries +# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html +Cargo.lock + +# These are backup files generated by rustfmt +**/*.rs.bk + +# MSVC Windows builds of rustc generate these, which store debugging information +*.pdb diff --git a/leptos_components/Cargo.toml b/leptos_components/Cargo.toml new file mode 100644 index 0000000..f008ccc --- /dev/null +++ b/leptos_components/Cargo.toml @@ -0,0 +1,7 @@ +[package] +name = "leptos_components" +version = "0.1.0" +edition = "2021" + +[dependencies] +leptos = { version = "0.7.0", features = ["csr", "ssr", "hydrate"] } diff --git a/leptos_components/src/lib.rs b/leptos_components/src/lib.rs new file mode 100644 index 0000000..bbcb4e2 --- /dev/null +++ b/leptos_components/src/lib.rs @@ -0,0 +1,11 @@ +use leptos::prelude::*; + + +#[component] +pub fn Button( + children: Children, +) -> impl IntoView { + view! { + + } +} \ No newline at end of file diff --git a/website/Cargo.toml b/website/Cargo.toml index dda8ec9..1119705 100644 --- a/website/Cargo.toml +++ b/website/Cargo.toml @@ -19,6 +19,7 @@ tower-http = { version = "0.5", features = ["fs"], optional = true } wasm-bindgen = "=0.2.99" thiserror = "1" http = "1" +leptos_components = {path="../leptos_components"} [features] hydrate = ["leptos/hydrate"] diff --git a/website/src/app.rs b/website/src/app.rs index 22a1178..1c357c0 100644 --- a/website/src/app.rs +++ b/website/src/app.rs @@ -4,6 +4,7 @@ use leptos_router::{ components::{Route, Router, Routes}, StaticSegment, }; +use leptos_components::Button; pub fn shell(options: LeptosOptions) -> impl IntoView { view! { @@ -57,5 +58,6 @@ fn HomePage() -> impl IntoView { view! {

"Welcome to Leptos!"

+ } }