make badge sizable and use badges for sidebar counts
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run
Rust / build (macos-latest, stable) (push) Waiting to run
Rust / build (ubuntu-latest, stable) (push) Waiting to run
Rust / build (windows-latest, stable) (push) Waiting to run
Rust / build (macos-latest, stable) (pull_request) Waiting to run
Rust / build (ubuntu-latest, stable) (pull_request) Waiting to run
Rust / build (windows-latest, stable) (pull_request) Waiting to run
This commit is contained in:
@@ -17,6 +17,7 @@ use signed_state::{
|
||||
};
|
||||
use ui::alert::{Alert, AlertSeverity};
|
||||
use ui::avatar::Avatar;
|
||||
use ui::badge::Badge;
|
||||
use ui::common::{Sizable as _, h_flex, v_flex};
|
||||
use ui::icons::{Icon, IconRole};
|
||||
use ui::layout::panel::Panel;
|
||||
@@ -886,19 +887,25 @@ impl RepoDetailView {
|
||||
let mut entries = vec![
|
||||
SidebarEntry::row("repo-nav-commits", "Commits")
|
||||
.prefix(Icon::named(IconRole::GitCommit))
|
||||
.when_some(commit_count, |entry, count| entry.suffix(count.to_string())),
|
||||
.when_some(commit_count, |entry, count| {
|
||||
entry.suffix(Badge::new(count, count.to_string()).xsmall())
|
||||
}),
|
||||
];
|
||||
|
||||
if include_issues {
|
||||
entries.push(
|
||||
SidebarEntry::row("repo-nav-issues", "Issues")
|
||||
.prefix(Icon::named(IconRole::GitIssueDone))
|
||||
.when_some(issue_count, |entry, count| entry.suffix(count.to_string())),
|
||||
.when_some(issue_count, |entry, count| {
|
||||
entry.suffix(Badge::new(count, count.to_string()).xsmall())
|
||||
}),
|
||||
);
|
||||
entries.push(
|
||||
SidebarEntry::row("repo-nav-pulls", "Pull requests")
|
||||
.prefix(Icon::named(IconRole::GitPullRequest))
|
||||
.when_some(pull_count, |entry, count| entry.suffix(count.to_string())),
|
||||
.when_some(pull_count, |entry, count| {
|
||||
entry.suffix(Badge::new(count, count.to_string()).xsmall())
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -991,6 +998,7 @@ impl Render for RepoDetailView {
|
||||
.severity(AlertSeverity::Danger)
|
||||
.title("Repository error")
|
||||
.message(error)
|
||||
.style(ui::alert::AlertStyle::Inline)
|
||||
.on_dismiss(move |cx| {
|
||||
if let Err(error) = weak.update(cx, |this, cx| {
|
||||
this.error = None;
|
||||
|
||||
Reference in New Issue
Block a user