cargo check all

This commit is contained in:
Jonathan Kelley committed 2024-01-23 16:58:29 -08:00
1 parent a5e61b0765
commit c0522bc152
10 files changed
+123 -329

No files matched your search

+1 -1
View File
@@ -5,7 +5,7 @@ fn main() {
}
fn app() -> Element {
let future = use_future(|| async move {
let future = use_resource(|| async move {
let mut eval = eval(
r#"
dioxus.send("Hi from JS!");
+1 -1
View File
@@ -27,7 +27,7 @@ fn app() -> Element {
button { onclick: move |_| count += 1, "Up high!" }
button { onclick: move |_| count -= 1, "Down low!" }
button { onclick: move |_| running.toggle(), "Toggle counter" }
button { onclick: move |_| saved_values.push(count.cloned().to_string()), "Save this value" }
button { onclick: move |_| saved_values.push(count().to_string()), "Save this value" }
button { onclick: move |_| saved_values.write().clear(), "Clear saved values" }
// We can do boolean operations on the current signal value
-99
View File
@@ -1,99 +0,0 @@
#![allow(non_snake_case)]
use dioxus::prelude::*;
use dioxus::router::prelude::*;
fn main() {
launch_desktop(|| {
rsx! {
Router::<Route> {}
}
});
}
#[derive(Routable, Clone)]
#[rustfmt::skip]
enum Route {
#[layout(NavBar)]
#[route("/")]
Home {},
#[nest("/new")]
#[route("/")]
BlogList {},
#[route("/:post")]
BlogPost {
post: String,
},
#[end_nest]
#[route("/oranges")]
Oranges {},
}
#[component]
fn NavBar() -> Element {
rsx! {
h1 { "Your app here" }
ul {
li {
Link { to: Route::Home {}, "home" }
}
li {
Link { to: Route::BlogList {}, "blog" }
}
li {
Link {
to: Route::BlogPost {
post: "tim".into(),
},
"tims' blog"
}
}
li {
Link {
to: Route::BlogPost {
post: "bill".into(),
},
"bills' blog"
}
}
li {
Link {
to: Route::BlogPost {
post: "james".into(),
},
"james amazing' blog"
}
}
}
Outlet::<Route> {}
}
}
#[component]
fn Home() -> Element {
println!("rendering home {:?}", current_scope_id());
rsx! { h1 { "Home" } }
}
#[component]
fn BlogList() -> Element {
println!("rendering blog list {:?}", current_scope_id());
rsx! { div { "Blog List" } }
}
#[component]
fn BlogPost(post: String) -> Element {
println!("rendering blog post {}", post);
rsx! {
div {
h3 { "blog post: {post}" }
Link { to: Route::BlogList {}, "back to blog list" }
}
}
}
#[component]
fn Oranges() -> Element {
rsx!("Oranges are not apples!")
}
-83
View File
@@ -1,83 +0,0 @@
use dioxus::prelude::*;
fn main() {
launch(app);
}
fn app() -> Element {
rsx! {
svg {
width: "200",
height: "250",
xmlns: "http://www.w3.org/2000/svg",
version: "1.1",
rect {
x: "10",
y: "10",
width: "30",
height: "30",
stroke: "black",
fill: "transparent",
stroke_width: "5",
}
rect {
x: "60",
y: "10",
width: "30",
height: "30",
stroke: "black",
fill: "transparent",
stroke_width: "5",
}
circle {
cx: "25",
cy: "75",
r: "20",
stroke: "red",
fill: "transparent",
stroke_width: "5",
}
ellipse {
cx: "75",
cy: "75",
rx: "20",
ry: "5",
stroke: "red",
fill: "transparent",
stroke_width: "5",
}
line {
x1: "10",
x2: "50",
y1: "110",
y2: "150",
stroke: "orange",
stroke_width: "5",
}
polyline {
points: "60 110 65 120 70 115 75 130 80 125 85 140 90 135 95 150 100 145",
stroke: "orange",
fill: "transparent",
stroke_width: "5",
}
polygon {
points: "50 160 55 180 70 180 60 190 65 205 50 195 35 205 40 190 30 180 45 180",
stroke: "green",
fill: "transparent",
stroke_width: "5",
}
path {
d: "M20,230 Q40,205 50,230 T90,230",
fill: "none",
stroke: "blue",
stroke_width: "5",
}
path {
d: "M9.00001 9C9 62 103.5 124 103.5 178",
stroke: "#3CC4DC",
stroke_linecap: "square",
stroke_width: "5",
}
}
}
}