feat(*): Add ability to toggle origins and forms

This commit is contained in:
Josh Creek
2024-07-12 14:35:25 +01:00
parent 704e618f84
commit 0e3be214ba
2 changed files with 40 additions and 19 deletions
+15 -2
View File
@@ -21,6 +21,17 @@
let creatingRecords = false;
let totalRecordsCreated = 0;
let showOrigins = true;
let showForms = true;
function toggleOrigins() {
showOrigins = !showOrigins;
}
function toggleForms() {
showForms = !showForms;
}
async function fetchPokeDexEntries() {
console.log('Fetching updated Pokedex entry data');
const response = await fetch('/api/pokedexentries');
@@ -164,8 +175,8 @@
<div class="container mx-auto">
{#if combinedData}
<div>
<button>Toggle Forms</button>
<button>Toggle Origins</button>
<button on:click={() => toggleForms()}>Toggle Forms</button>
<button on:click={() => toggleOrigins()}>Toggle Origins</button>
</div>
<!-- <p>
@@ -175,6 +186,8 @@
<div>
<PokedexEntryCatchRecord
{pokedexEntry}
{showOrigins}
{showForms}
bind:catchRecord
on:updateCatch={() => updateACatch(catchRecord)}
/>