+
+
+
+
+
+ {#each slicedList as group (group.id)}
+
+
+
+
+
+ {/each}
+
+
+{/if}
\ No newline at end of file
diff --git a/src/lib/member/List.svelte b/src/lib/member/List.svelte
index 5d4c648c..b67d497f 100644
--- a/src/lib/member/List.svelte
+++ b/src/lib/member/List.svelte
@@ -5,6 +5,7 @@
import FaSearch from 'svelte-icons/fa/FaSearch.svelte'
import { useParams } from 'svelte-navigator';
import type Member from '../../api/member';
+ import type Group from '../../api/group'
import PKAPI from '../../api';
import CardsHeader from '../CardsHeader.svelte';
import ListPagination from '../ListPagination.svelte';
@@ -12,7 +13,7 @@
export let isPublic: boolean;
let itemLoading = false;
- let list: Member[] = [];
+ export let list: Member[] = [];
let token = localStorage.getItem("pk-token");
let listLoading = true;
let err: string;
@@ -53,29 +54,29 @@
$: {searchValue; privacyFilter; currentPage = 1};
- $: searchedList = list.filter((member) => {
+ $: searchedList = list.filter((item) => {
if (!searchValue) return true;
switch (searchBy) {
- case "name": if (member.name.toLowerCase().includes(searchValue.toLowerCase())) return true;
+ case "name": if (item.name.toLowerCase().includes(searchValue.toLowerCase())) return true;
break;
- case "display name": if (member.display_name && member.display_name.toLowerCase().includes(searchValue.toLowerCase())) return true;
+ case "display name": if (item.display_name && item.display_name.toLowerCase().includes(searchValue.toLowerCase())) return true;
break;
- case "description": if (member.description && member.description.toLowerCase().includes(searchValue.toLowerCase())) return true;
+ case "description": if (item.description && item.description.toLowerCase().includes(searchValue.toLowerCase())) return true;
break;
- case "ID": if (member.id.toLowerCase().includes(searchValue.toLowerCase())) return true;
+ case "ID": if (item.id.toLowerCase().includes(searchValue.toLowerCase())) return true;
break;
- default: if (member.name.toLowerCase().includes(searchValue.toLowerCase())) return true;
+ default: if (item.name.toLowerCase().includes(searchValue.toLowerCase())) return true;
break;
}
return false;
})
- $: filteredList = searchedList.filter((member) => {
+ $: filteredList = searchedList.filter((item) => {
if (privacyFilter === "all") return true;
- if (privacyFilter === "public" && member.privacy.visibility === "public") return true;
- if (privacyFilter === "private" && member.privacy.visibility === "private") return true;
+ if (privacyFilter === "public" && item.privacy.visibility === "public") return true;
+ if (privacyFilter === "private" && item.privacy.visibility === "private") return true;
return false;
});
@@ -101,7 +102,7 @@
}
}
- $: if (sortOrder === "descending") sortedList = sortedList.reverse();
+ $:{sortOrder; if (sortOrder === "descending") sortedList = sortedList.reverse();}
$: indexOfLastItem = currentPage * itemsPerPage;
$: indexOfFirstItem = indexOfLastItem - itemsPerPage;
@@ -150,7 +151,7 @@
-
+ {#if !isPublic}{/if}
@@ -164,7 +165,8 @@
-
+ {#if !isPublic}
+
Only show
@@ -174,6 +176,7 @@
+ {/if}
@@ -188,10 +191,10 @@
{:else}
-
+
-
+
diff --git a/src/pages/Dash.svelte b/src/pages/Dash.svelte
index 07fae917..981c1c27 100644
--- a/src/pages/Dash.svelte
+++ b/src/pages/Dash.svelte
@@ -6,10 +6,14 @@
import System from '../lib/system/Main.svelte';
import PKAPI from '../api';
import Sys from '../api/system';
- import List from '../lib/member/List.svelte';
+ import MemberList from '../lib/member/List.svelte';
+ import GroupList from '../lib/group/List.svelte';
let isPublic = false;
+ let group = true;
+ let member = false;
+
// get the state from the navigator so that we know which tab to start on
let location = useLocation();
let params = $location.search && new URLSearchParams($location.search);
@@ -64,6 +68,10 @@
}
}
+ // some values that get passed from the member to the group components and vice versa
+ let members = [];
+ let groups = [];
+
@@ -78,8 +86,11 @@
-
-
+
+
+
+
+
diff --git a/src/pages/profiles/Main.svelte b/src/pages/profiles/Main.svelte
index 8c7403da..a0102390 100644
--- a/src/pages/profiles/Main.svelte
+++ b/src/pages/profiles/Main.svelte
@@ -6,13 +6,16 @@
import System from '../../lib/system/Main.svelte';
import PKAPI from '../../api';
import Sys from '../../api/system';
- import List from '../../lib/member/List.svelte';
+ import MemberList from '../../lib/member/List.svelte';
let isPublic = true;
let user = new Sys({});
let settings = JSON.parse(localStorage.getItem("pk-settings"));
+ let members = [];
+ let groups = [];
+
let params = useParams();
$: id = $params.id;
@@ -59,7 +62,7 @@
-
+
{/if}