From 45845c2a69e9309911721d0973d95d8b8816c25c Mon Sep 17 00:00:00 2001 From: John O'Keefe Date: Fri, 7 Feb 2025 22:57:05 -0500 Subject: [PATCH] finished switch from svelte table to tanstack table --- frontend/src/helperComponents/Anime.svelte | 1461 ++++++++--------- .../src/helperComponents/AnimeTable.svelte | 265 +-- .../AnimeTableTanstack.svelte | 118 -- 3 files changed, 870 insertions(+), 974 deletions(-) delete mode 100644 frontend/src/helperComponents/AnimeTableTanstack.svelte diff --git a/frontend/src/helperComponents/Anime.svelte b/frontend/src/helperComponents/Anime.svelte index d5e9c88..34f950c 100644 --- a/frontend/src/helperComponents/Anime.svelte +++ b/frontend/src/helperComponents/Anime.svelte @@ -1,133 +1,273 @@
-

- {title} -

-
-
- {title} Cover Image + {title} + +
+
+ {title} Cover Image + +
+ +
+
+
+ +
+ + - + +
+
+ / {currentAniListAnime.data.MediaList.media.nextAiringEpisode + .episode !== 0 + ? currentAniListAnime.data.MediaList.media.nextAiringEpisode + .episode - 1 + : currentAniListAnime.data.MediaList.media.episodes} +
+ {#if currentAniListAnime.data.MediaList.media.nextAiringEpisode.episode !== 0} +
+ of {currentAniListAnime.data.MediaList.media.episodes} +
+ {/if}
-
-
-
- -
- - - -
-
- / {currentAniListAnime.data.MediaList.media - .nextAiringEpisode.episode !== 0 - ? currentAniListAnime.data.MediaList.media - .nextAiringEpisode.episode - 1 - : currentAniListAnime.data.MediaList.media.episodes} -
- {#if currentAniListAnime.data.MediaList.media.nextAiringEpisode.episode !== 0} -
- of {currentAniListAnime.data.MediaList.media - .episodes} -
- {/if} -
- -
- - - {#each statusOptions as option} - - {/each} - -
-
-
-
- - -
-
- - -
-
- - -
-
-
-
- - -
-
+ bind:value={startingAnilistStatusOption} + > + {#each statusOptions as option} + + {/each} +
+
+
+
+ + +
+
+ + +
+
+ + +
+
+
+
+ + +
+
-
-
+
+
+ + -
+ on:click={async () => { + await CheckIfAniListLoggedInAndLoadWatchList(); + return push("/"); + }} + > + Go Home +
- - +
+ -
-
+
+
-
+ + + Delete Entries + +
+
+ + -
+ on:click={async () => { + await CheckIfAniListLoggedInAndLoadWatchList(); + return push("/"); + }} + > + Go Home +
+
-
-

Summary

-

{@html currentAniListAnime.data.MediaList.media.description}

-
+
+

Summary

+

{@html currentAniListAnime.data.MediaList.media.description}

+
diff --git a/frontend/src/helperComponents/AnimeTable.svelte b/frontend/src/helperComponents/AnimeTable.svelte index 8aa25b9..cd6a2d0 100644 --- a/frontend/src/helperComponents/AnimeTable.svelte +++ b/frontend/src/helperComponents/AnimeTable.svelte @@ -1,119 +1,166 @@ -
- - - {#each $headerRows as headerRow (headerRow.id)} - - - {#each headerRow.cells as cell (cell.id)} - - - - {/each} - - +
+
+
-
- - {#if props.sort.order === "asc"} - ⬇️ - {:else if props.sort.order === "desc"} - ⬆️ - {/if} -
-
+ + {#each $table.getHeaderGroups() as headerGroup} + + {#each headerGroup.headers as header} + {/each} - - - {#each $rows as row (row.id)} - - - {#each row.cells as cell (cell.id)} - - - - {/each} - - + + {/each} + + + {#each $table.getRowModel().rows as row} + + {#each row.getVisibleCells() as cell} + {/each} - + + {/each} +
+ {#if !header.isPlaceholder} +
+ + {#if header.column.getIsSorted().toString() === "asc"} + ⬆️ + {:else if header.column.getIsSorted().toString() === "desc"} + ⬇️ + {/if} +
+ {/if} +
- -
+ +
+
+ + + + + +
diff --git a/frontend/src/helperComponents/AnimeTableTanstack.svelte b/frontend/src/helperComponents/AnimeTableTanstack.svelte deleted file mode 100644 index 628ce14..0000000 --- a/frontend/src/helperComponents/AnimeTableTanstack.svelte +++ /dev/null @@ -1,118 +0,0 @@ - - -
- - - {#each $table.getHeaderGroups() as headerGroup} - - {#each headerGroup.headers as header} - - {/each} - - {/each} - - - {#each $table.getRowModel().rows as row} - - {#each row.getVisibleCells() as cell} - - {/each} - - {/each} - -
- {#if !header.isPlaceholder} - - {/if} -
- -
- -