pinakes-ui: streamline sidebar design
Signed-off-by: NotAShelf <raf@notashelf.dev> Change-Id: I0176fa480e5ba40eea5a39685a4f97896a6a6964
This commit is contained in:
parent
3e14bbe607
commit
278bcaa4b0
25 changed files with 1805 additions and 1686 deletions
|
|
@ -44,7 +44,20 @@ pub fn Duplicates(
|
|||
let is_expanded = expanded_group.read().as_ref() == Some(&hash);
|
||||
let hash_for_toggle = hash.clone();
|
||||
let item_count = group.items.len();
|
||||
let first_name = group.items.first()
|
||||
let first_name = group
|
||||
.items
|
||||
|
||||
// Group header
|
||||
|
||||
// Expanded: show items
|
||||
|
||||
// Thumbnail
|
||||
|
||||
// Info
|
||||
|
||||
// Actions
|
||||
|
||||
.first()
|
||||
.map(|i| i.file_name.clone())
|
||||
.unwrap_or_default();
|
||||
let total_size: u64 = group.items.iter().map(|i| i.file_size).sum();
|
||||
|
|
@ -53,13 +66,9 @@ pub fn Duplicates(
|
|||
} else {
|
||||
hash.clone()
|
||||
};
|
||||
|
||||
rsx! {
|
||||
div {
|
||||
class: "duplicate-group",
|
||||
key: "{hash}",
|
||||
div { class: "duplicate-group", key: "{hash}",
|
||||
|
||||
// Group header
|
||||
button {
|
||||
class: "duplicate-group-header",
|
||||
onclick: move |_| {
|
||||
|
|
@ -71,20 +80,21 @@ pub fn Duplicates(
|
|||
}
|
||||
},
|
||||
span { class: "expand-icon",
|
||||
if is_expanded { "\u{25bc}" } else { "\u{25b6}" }
|
||||
if is_expanded {
|
||||
"\u{25bc}"
|
||||
} else {
|
||||
"\u{25b6}"
|
||||
}
|
||||
}
|
||||
span { class: "group-name", "{first_name}" }
|
||||
span { class: "group-badge", "{item_count} files" }
|
||||
span { class: "group-size text-muted", "{format_size(total_size)}" }
|
||||
span { class: "group-hash mono text-muted",
|
||||
"{short_hash}"
|
||||
}
|
||||
span { class: "group-hash mono text-muted", "{short_hash}" }
|
||||
}
|
||||
|
||||
// Expanded: show items
|
||||
if is_expanded {
|
||||
div { class: "duplicate-items",
|
||||
for (idx, item) in group.items.iter().enumerate() {
|
||||
for (idx , item) in group.items.iter().enumerate() {
|
||||
{
|
||||
let item_id = item.id.clone();
|
||||
let is_first = idx == 0;
|
||||
|
|
@ -97,7 +107,10 @@ pub fn Duplicates(
|
|||
class: if is_first { "duplicate-item duplicate-item-keep" } else { "duplicate-item" },
|
||||
key: "{item_id}",
|
||||
|
||||
// Thumbnail
|
||||
|
||||
|
||||
|
||||
|
||||
div { class: "dup-thumb",
|
||||
if has_thumb {
|
||||
img {
|
||||
|
|
@ -110,7 +123,6 @@ pub fn Duplicates(
|
|||
}
|
||||
}
|
||||
|
||||
// Info
|
||||
div { class: "dup-info",
|
||||
div { class: "dup-filename", "{item.file_name}" }
|
||||
div { class: "dup-path mono text-muted", "{item.path}" }
|
||||
|
|
@ -121,7 +133,6 @@ pub fn Duplicates(
|
|||
}
|
||||
}
|
||||
|
||||
// Actions
|
||||
div { class: "dup-actions",
|
||||
if is_first {
|
||||
span { class: "keep-badge", "Keep" }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue