diff --git a/src/lib/components/Alert.svelte b/src/lib/components/Alert.svelte new file mode 100644 index 0000000..1897183 --- /dev/null +++ b/src/lib/components/Alert.svelte @@ -0,0 +1,88 @@ + + + + +
+ {#if $open} +
+
+

{title}

+

+ +

+
+ + +
+
+ {/if} +
+ + diff --git a/src/routes/(nav)/[[selectedMember]]/+page.svelte b/src/routes/(nav)/[[selectedMember]]/+page.svelte index 36f65fc..ca8cff6 100644 --- a/src/routes/(nav)/[[selectedMember]]/+page.svelte +++ b/src/routes/(nav)/[[selectedMember]]/+page.svelte @@ -1,6 +1,18 @@ + + diff --git a/src/routes/(nav)/[[selectedMember]]/Actions.svelte b/src/routes/(nav)/[[selectedMember]]/Actions.svelte index d7e8469..0298166 100644 --- a/src/routes/(nav)/[[selectedMember]]/Actions.svelte +++ b/src/routes/(nav)/[[selectedMember]]/Actions.svelte @@ -1,18 +1,25 @@
+
diff --git a/src/routes/(nav)/[[selectedMember]]/SendEmails.svelte b/src/routes/(nav)/[[selectedMember]]/SendEmails.svelte new file mode 100644 index 0000000..c778aa7 --- /dev/null +++ b/src/routes/(nav)/[[selectedMember]]/SendEmails.svelte @@ -0,0 +1,28 @@ + + + + You have {$selectedRows.length} contacts selected. + + + + diff --git a/src/routes/(nav)/[[selectedMember]]/Table.svelte b/src/routes/(nav)/[[selectedMember]]/Table.svelte index deedac0..61338a2 100644 --- a/src/routes/(nav)/[[selectedMember]]/Table.svelte +++ b/src/routes/(nav)/[[selectedMember]]/Table.svelte @@ -9,14 +9,19 @@ } from "@tanstack/svelte-table"; import type { SortingState, RowSelectionState, TableOptions } from "@tanstack/svelte-table"; import { CheckSquare, Square } from "lucide-svelte"; + import { getContext } from "svelte"; import { writable } from "svelte/store"; + import type { SelectedContacts } from "./+page.svelte"; + import type { GetContacts } from "$api/contacts"; import { page } from "$app/stores"; import Drawer from "$lib/components/Drawer.svelte"; import LineTableRow from "$lib/components/LineTableRow.svelte"; import { formatDateToPST } from "$lib/util/formatDateToPST"; + const selectedRows = getContext("selectedContacts"); + let sorting = [] as SortingState; let rowSelection = {} as RowSelectionState; const columnHelper = createColumnHelper(); @@ -82,6 +87,9 @@ rowSelection = updater; } + const selectedRowIds = Object.keys(rowSelection).filter((key) => rowSelection[key]); + selectedRows.set(selectedRowIds); + options.update((old) => ({ ...old, state: {