crates/extension/src/extension_store.rs 🔗
@@ -42,6 +42,7 @@ pub struct Extension {
pub description: Option<String>,
pub authors: Vec<String>,
pub repository: String,
+ pub download_count: usize,
}
#[derive(Clone)]
Marshall Bowers created
This PR adds the download count for extensions to the extensions view.
Release Notes:
- Added download counts for extensions to the extensions view.
crates/extension/src/extension_store.rs | 1
crates/extensions_ui/src/extensions_ui.rs | 30 +++++++++++++++----------
2 files changed, 19 insertions(+), 12 deletions(-)
@@ -42,6 +42,7 @@ pub struct Extension {
pub description: Option<String>,
pub authors: Vec<String>,
pub repository: String,
+ pub download_count: usize,
}
#[derive(Clone)]
@@ -236,18 +236,24 @@ impl ExtensionsPage {
),
)
.child(
- h_flex().justify_between().child(
- Label::new(format!(
- "{}: {}",
- if extension.authors.len() > 1 {
- "Authors"
- } else {
- "Author"
- },
- extension.authors.join(", ")
- ))
- .size(LabelSize::Small),
- ),
+ h_flex()
+ .justify_between()
+ .child(
+ Label::new(format!(
+ "{}: {}",
+ if extension.authors.len() > 1 {
+ "Authors"
+ } else {
+ "Author"
+ },
+ extension.authors.join(", ")
+ ))
+ .size(LabelSize::Small),
+ )
+ .child(
+ Label::new(format!("Downloads: {}", extension.download_count))
+ .size(LabelSize::Small),
+ ),
)
.child(
h_flex()