Skip to content

Commit 8858572

Browse files
committed
move button to top
1 parent 8bd6f1d commit 8858572

File tree

1 file changed

+17
-15
lines changed

1 file changed

+17
-15
lines changed

frameworks/keyed/dioxus/src/main.rs

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ struct RowData {
6363

6464
static ID_COUNTER: AtomicUsize = AtomicUsize::new(1);
6565

66+
6667
fn build_data(count: usize) -> Vec<RowData> {
6768
let mut thread_rng = thread_rng();
6869

@@ -92,6 +93,22 @@ fn build_data(count: usize) -> Vec<RowData> {
9293
data
9394
}
9495

96+
#[component]
97+
fn ActionButton(name: String, id: String, onclick: EventHandler) -> Element {
98+
rsx! {
99+
div {
100+
class: "col-sm-6 smallpad",
101+
button {
102+
class:"btn btn-primary btn-block",
103+
r#type: "button",
104+
id: id,
105+
onclick: move |_| onclick.call(()),
106+
"{name}",
107+
}
108+
}
109+
}
110+
}
111+
95112
#[component]
96113
fn app() -> Element {
97114
let mut data = use_signal(|| Vec::<RowData>::new());
@@ -195,18 +212,3 @@ fn app() -> Element {
195212
}
196213
}
197214

198-
#[component]
199-
fn ActionButton(name: String, id: String, onclick: EventHandler) -> Element {
200-
rsx! {
201-
div {
202-
class: "col-sm-6 smallpad",
203-
button {
204-
class:"btn btn-primary btn-block",
205-
r#type: "button",
206-
id: id,
207-
onclick: move |_| onclick.call(()),
208-
"{name}",
209-
}
210-
}
211-
}
212-
}

0 commit comments

Comments
 (0)