Skip to content

Commit

Permalink
Release 0.14.2
Browse files Browse the repository at this point in the history
  • Loading branch information
photino committed Oct 18, 2023
1 parent 621f43e commit 0afd69f
Show file tree
Hide file tree
Showing 10 changed files with 92 additions and 37 deletions.
3 changes: 2 additions & 1 deletion examples/dioxus-desktop/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "dioxus-desktop"
description = "An example for Dioxus desktop integration."
version = "0.1.0"
version = "0.1.1"
rust-version = "1.72"
edition = "2021"
publish = false
Expand All @@ -18,6 +18,7 @@ features = [
"bootstrap",
"font-awesome-brands",
"font-awesome-solid",
"octicons",
]

[dependencies.serde]
Expand Down
19 changes: 18 additions & 1 deletion examples/dioxus-desktop/Dioxus.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,22 @@ style = []
script = []

[bundle]
icon = ["public/favicon.ico"]
icon = [
"public/icons/32x32.png",
"public/icons/128x128.png",
"public/icons/[email protected]",
"public/icons/icon.ico",
]
resources = ["config", "public"]

[bundle.windows]
tsp = true
icon_path = "public/icons/icon.ico"
webview_install_mode = "Skip"
allow_downgrades = true

[bundle.windows.nsis]
installer_icon = "public/icons/icon.ico"
install_mode = "CurrentUser"
languages = ["SimpChinese", "TradChinese", "English"]
display_language_selector = true
Binary file added examples/dioxus-desktop/public/icons/128x128.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dioxus-desktop/public/icons/32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added examples/dioxus-desktop/public/icons/icon.ico
Binary file not shown.
6 changes: 1 addition & 5 deletions examples/dioxus-desktop/src/router/mod.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
use crate::view::{
layout::Wrapper,
overview::Overview,
stargazer::StargazerList,
};
use crate::view::{layout::Wrapper, overview::Overview, stargazer::StargazerList};
use dioxus::prelude::*;
use dioxus_router::prelude::*;

Expand Down
14 changes: 7 additions & 7 deletions examples/dioxus-desktop/src/view/layout.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ pub fn Wrapper(cx: Scope) -> Element {
Icon {
width: 16,
height: 16,
icon: BsDiagram3Fill,
icon: BsSpeedometer2,
}
span {
class: "ml-1",
Expand All @@ -50,9 +50,9 @@ pub fn Wrapper(cx: Scope) -> Element {
}
div {
class: "navbar-end",
Link {
a {
class: "navbar-item",
to: "https://github.com/photino/zino",
href: "https://github.com/photino/zino",
Icon {
width: 16,
height: 16,
Expand All @@ -63,9 +63,9 @@ pub fn Wrapper(cx: Scope) -> Element {
"github"
}
}
Link {
a {
class: "navbar-item",
to: "https://crates.io/crates/zino",
href: "https://crates.io/crates/zino",
Icon {
width: 16,
height: 16,
Expand All @@ -76,9 +76,9 @@ pub fn Wrapper(cx: Scope) -> Element {
"crates.io"
}
}
Link {
a {
class: "navbar-item",
to: "https://docs.rs/zino",
href: "https://docs.rs/zino",
Icon {
width: 16,
height: 16,
Expand Down
61 changes: 42 additions & 19 deletions examples/dioxus-desktop/src/view/overview.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use dioxus::prelude::*;
use dioxus_free_icons::{icons::go_icons::*, Icon};

pub fn Overview(cx: Scope) -> Element {
let data = [
Expand All @@ -18,26 +19,34 @@ pub fn Overview(cx: Scope) -> Element {
class: "card-header",
div {
class: "card-header-title",
"GitHub issues"
Icon {
width: 14,
height: 14,
icon: GoIssueOpened,
}
span {
class: "ml-1",
"GitHub issues"
}
}
}
div {
class: "card-content",
img {
class: "mr-2",
src: "https://img.shields.io/github/issues/photino/zino",
}
img {
a {
class: "mr-2",
src: "https://img.shields.io/github/issues/photino/zino/bug",
}
img {
class: "mr-2",
src: "https://img.shields.io/github/issues/photino/zino/enhancement",
href: "https://github.com/photino/zino/issues",
img {
src: "https://img.shields.io/github/issues/photino/zino",
}
}
img {
class: "mr-2",
src: "https://img.shields.io/github/issues/photino/zino/dependencies",
for label in ["bug", "enhancement", "dependencies"] {
a {
href: "https://github.com/photino/zino/labels/{label}",
img {
class: "mr-2",
src: "https://img.shields.io/github/issues/photino/zino/{label}",
}
}
}
}
}
Expand All @@ -50,7 +59,15 @@ pub fn Overview(cx: Scope) -> Element {
class: "card-header",
div {
class: "card-header-title",
"GitHub commits"
Icon {
width: 14,
height: 14,
icon: GoHistory,
}
span {
class: "ml-1",
"GitHub commits"
}
}
}
div {
Expand Down Expand Up @@ -95,13 +112,19 @@ pub fn Overview(cx: Scope) -> Element {
}
div {
class: "card-content",
img {
a {
class: "mr-2",
src: "https://img.shields.io/crates/v/{d.0}",
href: "https://crates.io/crates/{d.0}",
img {
src: "https://img.shields.io/crates/v/{d.0}",
}
}
img {
a {
class: "mr-2",
src: "https://shields.io/docsrs/{d.0}",
href: "https://docs.rs/{d.0}",
img {
src: "https://shields.io/docsrs/{d.0}",
}
}
img {
class: "mr-2",
Expand Down
26 changes: 22 additions & 4 deletions examples/dioxus-desktop/src/view/stargazer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,39 @@ use dioxus_free_icons::{icons::bs_icons::*, Icon};
use zino::prelude::*;

pub fn StargazerList(cx: Scope) -> Element {
let chart_type = use_state(cx, || "Date");
let mut page = use_state(cx, || 1);
let stargazers = use_future(cx, (page,), |(page,)| service::stargazer::list_stargazers(10, *page));
let stargazers = use_future(cx, (page,), |(page,)| {
service::stargazer::list_stargazers(10, *page)
});
match stargazers.value() {
Some(Ok(items)) => {
let prev_invisible = if **page == 1 { "is-invisible" } else { "" };
let next_invisible = if items.len() < 10 { "is-invisible" } else { "" };
render! {
div {
class: "columns is-6",
class: "columns is-desktop is-6",
div {
class: "column",
label {
class: "checkbox is-pulled-right",
input {
r#type: "checkbox",
onchange: |event| {
let value = if event.value == "true" { "Timeline" } else { "Date" };
chart_type.set(value);
},
}
span {
class: "ml-1",
"Align timeline"
}
}
img {
margin_top: "-30px",
width: 800,
height: 533,
src: "https://api.star-history.com/svg?repos=photino/zino&type=Timeline",
src: "https://api.star-history.com/svg?repos=photino/zino&type={chart_type}",
}
}
div {
Expand All @@ -28,7 +46,7 @@ pub fn StargazerList(cx: Scope) -> Element {
thead {
tr {
th {}
th { "Account" }
th { "Username" }
th { "Avatar" }
th { "Starred at" }
}
Expand Down

0 comments on commit 0afd69f

Please sign in to comment.