Skip to content

Commit

Permalink
Updated leptos example
Browse files Browse the repository at this point in the history
  • Loading branch information
myFavShrimp committed Oct 20, 2023
1 parent df8e8fb commit e13a894
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 13 deletions.
6 changes: 1 addition & 5 deletions examples/leptos-example/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies.leptos]
version = "0.4.6"
version = "0.5.1"
features = ["csr"]

[dependencies.turf]
Expand All @@ -23,7 +23,3 @@ template = "leptos-example_<original_name>_<id>"
chrome = [80, 1, 2]
firefox = 65
safari = [12, 3]

[package.metadata.turf.file_output]
global_css_file_path = "./test-global.css"
separate_css_files_path = "./test-separate/"
6 changes: 3 additions & 3 deletions examples/leptos-example/src/counter_component.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ use leptos::*;
turf::style_sheet!("src/counter_component.scss");

#[component]
pub fn CounterComponent(cx: Scope) -> impl IntoView {
let (count, set_count) = create_signal(cx, 0);
pub fn CounterComponent() -> impl IntoView {
let (count, set_count) = create_signal(0);

view! { cx,
view! {
<style>{STYLE_SHEET}</style>
<div class=ClassName::COUNTER_BUTTON>
<button on:click=move |_| { set_count.update(|n| *n += 1) }>
Expand Down
4 changes: 2 additions & 2 deletions examples/leptos-example/src/hello_leptos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ use leptos::*;
turf::style_sheet!("src/hello_leptos.scss");

#[component]
pub fn HelloLeptos(cx: Scope) -> impl IntoView {
view! { cx,
pub fn HelloLeptos() -> impl IntoView {
view! {
<style>{STYLE_SHEET}</style>
<div class=ClassName::HELLO_LEPTOS>
<h1>"Hello, Leptos!"</h1>
Expand Down
8 changes: 5 additions & 3 deletions examples/leptos-example/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@ use counter_component::*;
use hello_leptos::*;

fn main() {
mount_to_body(|cx| view! { cx,
<HelloLeptos />
<CounterComponent />
mount_to_body(|| {
view! {
<HelloLeptos />
<CounterComponent />
}
})
}

0 comments on commit e13a894

Please sign in to comment.