Display extension download counts (#7864)

This PR adds the download count for extensions to the extensions view.

Release Notes:

- Added download counts for extensions to the extensions view.
This commit is contained in:
Marshall Bowers 2024-02-15 16:41:54 -05:00 committed by GitHub
parent a8d5864524
commit 23132b5ab1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 12 deletions

View file

@ -42,6 +42,7 @@ pub struct Extension {
pub description: Option<String>,
pub authors: Vec<String>,
pub repository: String,
pub download_count: usize,
}
#[derive(Clone)]

View file

@ -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()