Make cargo check --all --examples work!

This commit is contained in:
Jonathan Kelley committed 2024-01-19 14:19:49 -08:00
1 parent 08475af221
commit 83bce6ce97
40 files changed
+295 -399

No files matched your search

+9 -18
View File
@@ -1,29 +1,22 @@
#![allow(non_snake_case)]
use dioxus::prelude::*;
use dioxus_tui::Config;
fn main() {
dioxus_tui::launch_cfg(app, Config::default());
dioxus_tui::launch_cfg(app, Default::default());
}
#[derive(Props, PartialEq)]
struct QuadrentProps {
color: String,
text: String,
}
fn Quadrant(cx: Scope<QuadrentProps>) -> Element {
#[component]
fn Quadrant(color: String, text: String) -> Element {
rsx! {
div {
border_width: "1px",
width: "50%",
height: "100%",
background_color: "{cx.props.color}",
justify_content: "center",
align_items: "center",
"{cx.props.text}"
background_color: "{color}",
"{text}"
}
}
}
@@ -34,30 +27,28 @@ fn app() -> Element {
width: "100%",
height: "100%",
flex_direction: "column",
div {
width: "100%",
height: "50%",
flex_direction: "row",
Quadrant{
Quadrant {
color: "red".to_string(),
text: "[A]".to_string()
},
Quadrant{
Quadrant {
color: "black".to_string(),
text: "[B]".to_string()
}
}
div {
width: "100%",
height: "50%",
flex_direction: "row",
Quadrant{
Quadrant {
color: "green".to_string(),
text: "[C]".to_string()
},
Quadrant{
Quadrant {
color: "blue".to_string(),
text: "[D]".to_string()
}