chore: remove unnecessary brackets from examples (#552)

This commit is contained in:
Jon Kelley authored and GitHub committed 2022-09-13 14:57:23 -07:00
1 parent e4466fee0a
commit 41b450eedf
11 files changed
+44 -52

No files matched your search

+6 -5
View File
@@ -1,3 +1,5 @@
#![allow(non_snake_case)]
use dioxus::prelude::*;
use dioxus_elements::input_data::keyboard_types::Key;
@@ -5,14 +7,14 @@ fn main() {
dioxus_desktop::launch(app);
}
#[derive(PartialEq)]
#[derive(Eq, PartialEq)]
pub enum FilterState {
All,
Active,
Completed,
}
#[derive(Debug, PartialEq, Clone)]
#[derive(Debug, Eq, PartialEq, Clone)]
pub struct TodoItem {
pub id: u32,
pub checked: bool,
@@ -46,7 +48,7 @@ pub fn app(cx: Scope<()>) -> Element {
cx.render(rsx!{
section { class: "todoapp",
style { [include_str!("./assets/todomvc.css")] }
style { include_str!("./assets/todomvc.css") }
div {
header { class: "header",
h1 {"todos"}
@@ -86,7 +88,7 @@ pub fn app(cx: Scope<()>) -> Element {
li { class: "Active", a { onclick: move |_| filter.set(FilterState::Active), "Active" }}
li { class: "Completed", a { onclick: move |_| filter.set(FilterState::Completed), "Completed" }}
}
(show_clear_completed).then(|| rsx!(
show_clear_completed.then(|| rsx!(
button {
class: "clear-completed",
onclick: move |_| todos.make_mut().retain(|_, todo| !todo.checked),
@@ -123,7 +125,6 @@ pub fn TodoEntry<'a>(cx: Scope<'a, TodoEntryProps<'a>>) -> Element {
li {
class: "{completed} {editing}",
div { class: "view",
input {
class: "toggle",
r#type: "checkbox",