Skip to content

Commit

Permalink
Display extension download counts (#7864)
Browse files Browse the repository at this point in the history
This PR adds the download count for extensions to the extensions view.

Release Notes:

- Added download counts for extensions to the extensions view.
  • Loading branch information
maxdeviant authored Feb 15, 2024
1 parent a8d5864 commit 23132b5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
1 change: 1 addition & 0 deletions crates/extension/src/extension_store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ pub struct Extension {
pub description: Option<String>,
pub authors: Vec<String>,
pub repository: String,
pub download_count: usize,
}

#[derive(Clone)]
Expand Down
30 changes: 18 additions & 12 deletions crates/extensions_ui/src/extensions_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 23132b5

Please sign in to comment.