From c9f31f9059a9ee8fce0399cff883b5dec32a1f09 Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Sat, 13 Dec 2025 18:07:02 -0800 Subject: [PATCH] add crew invitation modals - InvitationsModal: view/accept/decline pending invitations - InviteUserModal: confirm invite from profile page - ScoutUserModal: search users by username to invite --- .../components/crew/InvitationsModal.svelte | 274 ++++++++++++++++ .../components/crew/InviteUserModal.svelte | 139 +++++++++ src/lib/components/crew/ScoutUserModal.svelte | 294 ++++++++++++++++++ 3 files changed, 707 insertions(+) create mode 100644 src/lib/components/crew/InvitationsModal.svelte create mode 100644 src/lib/components/crew/InviteUserModal.svelte create mode 100644 src/lib/components/crew/ScoutUserModal.svelte diff --git a/src/lib/components/crew/InvitationsModal.svelte b/src/lib/components/crew/InvitationsModal.svelte new file mode 100644 index 00000000..3cad1573 --- /dev/null +++ b/src/lib/components/crew/InvitationsModal.svelte @@ -0,0 +1,274 @@ + + + + + + + + + {#if isLoading} +
+ +

Loading invitations...

+
+ {:else if invitations.length === 0} +
+ +

No pending invitations

+

You'll see crew invitations here when you receive them.

+
+ {:else} +
+ {#each invitations as invitation} + {@const expired = isExpired(invitation.expiresAt)} + {@const crew = invitation.crew} + {@const invitedBy = invitation.invitedBy} + {@const isProcessing = processingId === invitation.id} + + {#if crew} +
+
+
+
+ {crew.name} + {#if crew.gamertag} + [{crew.gamertag}] + {/if} +
+ {#if invitedBy} + + Invited by {invitedBy.username} + + {/if} +
+ + {#if expired} +
Expired
+ {:else} +
+ Expires {formatDate(invitation.expiresAt)} +
+ {/if} +
+ + {#if !expired} +
+ + +
+ {/if} +
+ {/if} + {/each} +
+ {/if} +
+
+ + diff --git a/src/lib/components/crew/InviteUserModal.svelte b/src/lib/components/crew/InviteUserModal.svelte new file mode 100644 index 00000000..7fddb81e --- /dev/null +++ b/src/lib/components/crew/InviteUserModal.svelte @@ -0,0 +1,139 @@ + + + + + + + + + {#if success} +
+

Invitation sent to {username}!

+
+ {:else} +
+

+ Are you sure you want to invite {username} to join your crew? +

+

+ They will receive the invitation and can choose to accept or decline. +

+
+ + {#if error} +
+

{error}

+
+ {/if} + {/if} +
+ + {#if !success} + + + + + {/if} +
+ + diff --git a/src/lib/components/crew/ScoutUserModal.svelte b/src/lib/components/crew/ScoutUserModal.svelte new file mode 100644 index 00000000..1c795d3d --- /dev/null +++ b/src/lib/components/crew/ScoutUserModal.svelte @@ -0,0 +1,294 @@ + + + + + + + + + {#if inviteSuccess} +
+ +

Invitation sent to {foundUser?.username}!

+
+ {:else} + +
+
+ + +
+ + {#if searchError} +

{searchError}

+ {/if} +
+ + + {#if foundUser} +
+ + + {#if inviteError} +
+

{inviteError}

+
+ {/if} +
+ {/if} + {/if} +
+ + {#if !inviteSuccess} + + + {#if foundUser} + + {/if} + + {/if} +
+ +