mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 21:32:40 +00:00
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:
parent
a8d5864524
commit
23132b5ab1
2 changed files with 19 additions and 12 deletions
|
@ -42,6 +42,7 @@ pub struct Extension {
|
||||||
pub description: Option<String>,
|
pub description: Option<String>,
|
||||||
pub authors: Vec<String>,
|
pub authors: Vec<String>,
|
||||||
pub repository: String,
|
pub repository: String,
|
||||||
|
pub download_count: usize,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Clone)]
|
#[derive(Clone)]
|
||||||
|
|
|
@ -236,18 +236,24 @@ impl ExtensionsPage {
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
h_flex().justify_between().child(
|
h_flex()
|
||||||
Label::new(format!(
|
.justify_between()
|
||||||
"{}: {}",
|
.child(
|
||||||
if extension.authors.len() > 1 {
|
Label::new(format!(
|
||||||
"Authors"
|
"{}: {}",
|
||||||
} else {
|
if extension.authors.len() > 1 {
|
||||||
"Author"
|
"Authors"
|
||||||
},
|
} else {
|
||||||
extension.authors.join(", ")
|
"Author"
|
||||||
))
|
},
|
||||||
.size(LabelSize::Small),
|
extension.authors.join(", ")
|
||||||
),
|
))
|
||||||
|
.size(LabelSize::Small),
|
||||||
|
)
|
||||||
|
.child(
|
||||||
|
Label::new(format!("Downloads: {}", extension.download_count))
|
||||||
|
.size(LabelSize::Small),
|
||||||
|
),
|
||||||
)
|
)
|
||||||
.child(
|
.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
|
|
Loading…
Reference in a new issue