diff --git a/assets/img/icons/drawer-out.svg b/assets/img/icons/drawer-out.svg new file mode 100755 index 0000000..c73cc57 --- /dev/null +++ b/assets/img/icons/drawer-out.svg @@ -0,0 +1,5 @@ + + + + + diff --git a/components/stashes/menu.vue b/components/stashes/menu.vue index 60de55f..f519deb 100644 --- a/components/stashes/menu.vue +++ b/components/stashes/menu.vue @@ -30,6 +30,7 @@ const domainKey = { }[props.domain]; const sortedStashes = computed(() => props.stashes + .filter((stash) => !stash.isArchived) .toSorted((stashA, stashB) => { return stashA.createdAt - stashB.createdAt; }) diff --git a/components/stashes/stashes.vue b/components/stashes/stashes.vue index f959d47..0f79045 100644 --- a/components/stashes/stashes.vue +++ b/components/stashes/stashes.vue @@ -13,6 +13,7 @@ const stashes = ref(pageContext.pageProps.stashes); const profile = ref(pageContext.pageProps.profile); const showStashDialog = ref(false); +const showArchived = ref(false); const sortings = ['used', 'name', 'size', 'created']; const sorting = ref('size'); @@ -50,6 +51,9 @@ const sortedStashes = computed(() => stashes.value return stashB.isPrimary - stashA.isPrimary; })); +const activeStashes = computed(() => sortedStashes.value.filter((stash) => !stash.isArchived)); +const archivedStashes = computed(() => sortedStashes.value.filter((stash) => stash.isArchived)); + function toggleSorting() { sorting.value = sortings[(sortings.indexOf(sorting.value) + 1) % sortings.length]; } @@ -108,7 +112,29 @@ function toggleSorting() { + +

{{ showArchived ? 'Hide' : `Show ${archivedStashes.length}` }} archived {{ archivedStashes.length > 1 ? 'stashes' : 'stash' }}

+ +