From 6468068ca4b17326fb73c0b9b034b0590bd28cdf Mon Sep 17 00:00:00 2001 From: Jake/Rads Date: Mon, 27 Jun 2022 11:55:54 +0200 Subject: [PATCH] feat(dashboard): reuse list component more thoroughly --- dashboard/src/lib/list/CardsList.svelte | 156 ++++++++++++++++++++++++ dashboard/src/lib/list/List.svelte | 147 +--------------------- dashboard/src/pages/Group.svelte | 63 +--------- dashboard/src/pages/Member.svelte | 64 +--------- 4 files changed, 166 insertions(+), 264 deletions(-) create mode 100644 dashboard/src/lib/list/CardsList.svelte diff --git a/dashboard/src/lib/list/CardsList.svelte b/dashboard/src/lib/list/CardsList.svelte new file mode 100644 index 00000000..58b5464f --- /dev/null +++ b/dashboard/src/lib/list/CardsList.svelte @@ -0,0 +1,156 @@ + + +{#if settings && settings.accessibility ? (!settings.accessibility.expandedcards && !settings.accessibility.pagelinks) : true} +
+ {#each list as item, index (item.id + index)} + +

+ +

+ + + {#if itemType === "member"} + + {:else if itemType === "group"} + + {/if} + + +
+ {/each} +
+{:else if settings.accessibility.expandedcards} + {#each list as item, index (item.id + index)} + + + + {#if itemType === "member"} + + {:else if itemType === "group"} + + {/if} + + + {/each} +{:else} +
+ {#each list as item, index (item.id + index)} + + + + {/each} +
+{/if} \ No newline at end of file diff --git a/dashboard/src/lib/list/List.svelte b/dashboard/src/lib/list/List.svelte index ebd1b7a6..0692cf2d 100644 --- a/dashboard/src/lib/list/List.svelte +++ b/dashboard/src/lib/list/List.svelte @@ -1,20 +1,14 @@ @@ -185,90 +132,6 @@ {/if} {/if} - - -{#if settings && settings.accessibility ? (!settings.accessibility.expandedcards && !settings.accessibility.pagelinks) : true} - {#each slicedList as item, index (item.id + index)} - -

- -

- - - {#if itemType === "member"} - - {:else if itemType === "group"} - - {/if} - - -
- {/each} -{:else if settings.accessibility.expandedcards} - {#each slicedList as item, index (item.id + index)} - -
skipToNextItem(e, index)} tabindex={0}> - - -
- {#if isPublic || item.privacy.visibility === "public"} - {#if itemType === "member"} - - {:else if itemType === "group"} - - {/if} - {:else} - - {/if} -
-
-
-
- - {#if itemType === "member"} - - {:else if itemType === "group"} - - {/if} - -
- {/each} -{:else} - -{/if} + -{/if} \ No newline at end of file +{/if} diff --git a/dashboard/src/pages/Group.svelte b/dashboard/src/pages/Group.svelte index b9abbe34..73119ae8 100644 --- a/dashboard/src/pages/Group.svelte +++ b/dashboard/src/pages/Group.svelte @@ -1,7 +1,6 @@