This commit is contained in:
Austen Adler 2023-03-22 23:48:07 -04:00
parent deea258220
commit 67c5cb977a
3 changed files with 31 additions and 27 deletions

View File

@ -14,12 +14,12 @@ let tabInfo = {
selected: 0, selected: 0,
tabs: [ tabs: [
{ {
label: "Map", label: 'Map',
idx: 0, idx: 0
}, },
{ {
label: "Share", label: 'Share',
idx: 1, idx: 1
} }
] ]
}; };
@ -189,7 +189,6 @@ let tabInfo = {
{#if tabInfo.selected === 1} {#if tabInfo.selected === 1}
<CoordinateInfo bind:xpin={addr} /> <CoordinateInfo bind:xpin={addr} />
{/if} {/if}
{:catch message} {:catch message}
<Error {message}>Could not start core module</Error> <Error {message}>Could not start core module</Error>
{/await} {/await}

View File

@ -3,12 +3,17 @@
const updateSelectedTab = (tab) => { const updateSelectedTab = (tab) => {
tabInfo.selected = tab.idx; tabInfo.selected = tab.idx;
} };
</script> </script>
<ul class="flex"> <ul class="flex">
{#each tabInfo.tabs as tab} {#each tabInfo.tabs as tab}
<li class:bg-blue-200="{tab.idx === tabInfo.selected}" on:click={() => updateSelectedTab(tab)} class="p-2 block">{tab.label}</li> <li
class:bg-blue-200={tab.idx === tabInfo.selected}
on:click={() => updateSelectedTab(tab)}
class="p-2 block"
>
{tab.label}
</li>
{/each} {/each}
</ul> </ul>