diff --git a/ui/src/components/Inspect.svelte b/ui/src/components/Inspect.svelte index 0cf0c36..0aa3c08 100644 --- a/ui/src/components/Inspect.svelte +++ b/ui/src/components/Inspect.svelte @@ -5,10 +5,18 @@ import { UpType } from "../lib/types"; import type { IEntry } from "upend/types"; import BlobPreview from "./BlobPreview.svelte"; + import { setContext } from "svelte"; + import { writable } from "svelte/store"; export let address: string; + export let index: number | undefined; export let editable = false; + let indexStore = writable(index); + $: $indexStore = index; + + setContext("browse", { index: indexStore }); + const { error, revalidate, attributes, backlinks } = useEntity(address); $: allTypeAddresses = $attributes diff --git a/ui/src/components/UpLink.svelte b/ui/src/components/UpLink.svelte index b0de712..f5d4fde 100644 --- a/ui/src/components/UpLink.svelte +++ b/ui/src/components/UpLink.svelte @@ -1,20 +1,31 @@ diff --git a/ui/src/views/Browse.svelte b/ui/src/views/Browse.svelte index ad4f99d..13bce63 100644 --- a/ui/src/views/Browse.svelte +++ b/ui/src/views/Browse.svelte @@ -29,28 +29,28 @@
- {#each addresses as address, idx (address)} + {#each addresses as address, index (address)}
(editable[idx] = !editable[idx])} + on:click={() => (editable[index] = !editable[index])} />
- +
{/each}