From c358a4fe70ccadf2663a1af0e402993278c15ded Mon Sep 17 00:00:00 2001 From: ShowierData9978 Date: Tue, 12 Dec 2023 20:03:23 -0600 Subject: [PATCH] feat: Invites and better bans page --- src/lib/modals/chats/BannedMembers.svelte | 30 +++++++- src/lib/modals/chats/Invites.svelte | 94 +++++++++++++++++++++++ src/lib/stores.js | 1 + src/pages/chats/[chatid].svelte | 12 ++- src/pages/invite/[invite].svelte | 51 ++++++++++++ 5 files changed, 182 insertions(+), 6 deletions(-) create mode 100644 src/lib/modals/chats/Invites.svelte create mode 100644 src/pages/invite/[invite].svelte diff --git a/src/lib/modals/chats/BannedMembers.svelte b/src/lib/modals/chats/BannedMembers.svelte index f5e614e1..63679e81 100644 --- a/src/lib/modals/chats/BannedMembers.svelte +++ b/src/lib/modals/chats/BannedMembers.svelte @@ -5,6 +5,7 @@ import Modal from "../../Modal.svelte"; import * as modals from "../../modals" import Spinner from '../../Spinner.svelte'; + import Container from '../../Container.svelte'; async function fetchBannedMembers() { const resp = await fetch(`${apiUrl}chats/${$chat._id}/bans`, { @@ -33,18 +34,20 @@ {#each $chat.banned_users as member} -

+ - Reason: {member.message} +

+

Reason: {member.message}

- -

+
+ {/each} {/await} @@ -56,4 +59,23 @@ justify-content: center; text-align: center; } + + .delete { + justify-content: right; + flex: right; + height: 100%; + } + + .inline { + display: flex; + flex-direction: row; + justify-content: space-between; + align-items: left; + vertical-align: middle; + } + + .inline p { + justify-self: center; + align-self: center; + } \ No newline at end of file diff --git a/src/lib/modals/chats/Invites.svelte b/src/lib/modals/chats/Invites.svelte new file mode 100644 index 00000000..ee648022 --- /dev/null +++ b/src/lib/modals/chats/Invites.svelte @@ -0,0 +1,94 @@ + + + +

+ Chat Invites +

+ +
+ {#await fetchInvites()} + + {/await} + + {#each $chat.invites as invite} + +
+ + https://app.meower.org/invite/{invite._id} + +
+ +
+
+ +
+ {/each} +
+ +
+ +
+ + \ No newline at end of file diff --git a/src/lib/stores.js b/src/lib/stores.js index 464d5ff2..31730ac3 100644 --- a/src/lib/stores.js +++ b/src/lib/stores.js @@ -40,6 +40,7 @@ export const chat = writable({ last_active: 0, deleted: false, banned_users: [], + invites: [] }); // User list diff --git a/src/pages/chats/[chatid].svelte b/src/pages/chats/[chatid].svelte index a4d3c546..ca28eea0 100644 --- a/src/pages/chats/[chatid].svelte +++ b/src/pages/chats/[chatid].svelte @@ -2,6 +2,7 @@ Home but it's a group chat. --> @@ -185,6 +188,11 @@ )}> B +