updates: move to stable versions

This commit is contained in:
Jonathan Kelley committed 2022-01-12 09:40:36 -05:00
1 parent c884f8c1b8
commit 395558232e
13 files changed
+233 -65

No files matched your search

+1 -4
View File
@@ -1,10 +1,7 @@
use dioxus::prelude::*;
fn main() {
let mut dom = VirtualDom::new(app);
dom.rebuild();
rink::render_vdom(&mut dom).unwrap();
rink::launch(app);
}
fn app(cx: Scope) -> Element {
+59
View File
@@ -0,0 +1,59 @@
use std::cell::RefCell;
use crossterm::event::KeyEvent;
use dioxus::prelude::*;
use rink::InputHandler;
fn main() {
rink::launch(app);
}
fn app(cx: Scope) -> Element {
let count = use_state(&cx, || 0);
cx.render(rsx! {
div {
width: "100%",
height: "10px",
background_color: "red",
justify_content: "center",
align_items: "center",
"Hello world!",
// todo: enabling this will panic
// rink::InputHandler {
// onkeydown: move |evt: KeyEvent| {
// use crossterm::event::KeyCode::*;
// match evt.code {
// Left => count += 1,
// Right => count -= 1,
// Up => count += 10,
// Down => count -= 10,
// _ => {},
// }
// },
// onmousedown: move |evt| {},
// onresize: move |dims| {
// println!("{:?}", dims);
// },
// }
}
})
}
fn app2<'a>(cx: Scope<'a>) -> Element<'a> {
let mut count = use_state(&cx, || 0);
cx.render(rsx! {
div {
width: "100%",
height: "10px",
background_color: "red",
justify_content: "center",
align_items: "center",
oninput: move |_| count += 1,
"Hello world!",
h1 {},
}
})
}
+1 -4
View File
@@ -1,10 +1,7 @@
use dioxus::prelude::*;
fn main() {
let mut dom = VirtualDom::new(app);
dom.rebuild();
rink::render_vdom(&mut dom).unwrap();
rink::launch(app);
}
fn app(cx: Scope) -> Element {
+3 -12
View File
@@ -1,10 +1,7 @@
use dioxus::prelude::*;
fn main() {
let mut dom = VirtualDom::new(app);
dom.rebuild();
rink::render_vdom(&mut dom).unwrap();
rink::launch(app);
}
fn app(cx: Scope) -> Element {
@@ -16,44 +13,38 @@ fn app(cx: Scope) -> Element {
background_color: "black",
// margin_right: "10px",
div {
width: "70%",
height: "70%",
// margin_left: "4px",
background_color: "green",
// margin_left: "4px",
div {
width: "100%",
height: "100%",
margin_top: "2px",
margin_bottom: "2px",
margin_left: "2px",
margin_right: "2px",
// flex_shrink: "0",
flex_shrink: "0",
background_color: "red",
justify_content: "center",
align_items: "center",
flex_direction: "column",
// padding_top: "2px",
// padding_bottom: "2px",
// padding_left: "4px",
// padding_right: "4px",
"[A]"
"[A]"
"[A]"
"[A]"
}
}
}
})
}
+1 -4
View File
@@ -1,10 +1,7 @@
use dioxus::prelude::*;
fn main() {
let mut dom = VirtualDom::new(app);
dom.rebuild();
rink::render_vdom(&mut dom).unwrap();
rink::launch(app);
}
fn app(cx: Scope) -> Element {
+1 -4
View File
@@ -1,10 +1,7 @@
use dioxus::prelude::*;
fn main() {
let mut dom = VirtualDom::new(app);
dom.rebuild();
rink::render_vdom(&mut dom).unwrap();
rink::launch(app);
}
fn app(cx: Scope) -> Element {
+1 -4
View File
@@ -1,10 +1,7 @@
use dioxus::prelude::*;
fn main() {
let mut dom = VirtualDom::new(app);
dom.rebuild();
rink::render_vdom(&mut dom).unwrap();
rink::launch(app);
}
fn app(cx: Scope) -> Element {
+1 -4
View File
@@ -1,10 +1,7 @@
use dioxus::prelude::*;
fn main() {
let mut dom = VirtualDom::new(app);
dom.rebuild();
rink::render_vdom(&mut dom).unwrap();
rink::launch(app);
}
fn app(cx: Scope) -> Element {
+5
View File
@@ -0,0 +1,5 @@
div {
div {
}
}