mirror of
https://seed.radicle.dev/rad:z4D5UCArafTzTQpDZNQRuqswh3ury.git
synced 2026-10-18 19:10:45 +08:00
Mark private repos with a lock in the sidebar
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
|
||||
|
||||
export type RepoSummary = { rid: string; name: string };
|
||||
export type RepoSummary = { rid: string; name: string; private: boolean };
|
||||
|
||||
@@ -18,6 +18,7 @@ pub struct RepoSummary {
|
||||
#[ts(as = "String")]
|
||||
pub rid: identity::RepoId,
|
||||
pub name: String,
|
||||
pub private: bool,
|
||||
}
|
||||
|
||||
#[derive(Serialize, TS)]
|
||||
|
||||
@@ -408,6 +408,7 @@ pub trait Repo: Profile {
|
||||
entries.push(repo::RepoSummary {
|
||||
rid,
|
||||
name: data.name,
|
||||
private: doc.is_private(),
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -525,6 +525,11 @@
|
||||
background-color: var(--color-surface-mid);
|
||||
}
|
||||
|
||||
.private-icon {
|
||||
display: inline-flex;
|
||||
flex-shrink: 0;
|
||||
color: var(--color-text-tertiary);
|
||||
}
|
||||
/* Out of flow: hidden, they still reserved a button's width on every row.
|
||||
They sit over the end of the name instead, on the row's own fill. */
|
||||
.nav-item .row-actions {
|
||||
@@ -860,6 +865,11 @@
|
||||
href={router.routeToPath({ resource: "repo.home", rid: repo.rid })}>
|
||||
<RepoAvatar name={repo.name} rid={repo.rid} styleWidth="1rem" />
|
||||
<span class="txt-overflow label">{repo.name}</span>
|
||||
{#if repo.private}
|
||||
<span class="private-icon" title="Private repository">
|
||||
<Icon name="lock" />
|
||||
</span>
|
||||
{/if}
|
||||
<span
|
||||
class="row-actions"
|
||||
role="none"
|
||||
|
||||
Reference in New Issue
Block a user