[ui] first step of search

feat/vaults
Tomáš Mládek 2022-01-13 19:08:36 +01:00
parent 0dab348f58
commit ec691b3717
No known key found for this signature in database
GPG Key ID: ED21612889E75EC5
2 changed files with 78 additions and 5 deletions

View File

@ -0,0 +1,48 @@
<script lang="ts">
import type { UpEntry } from "upend";
import UpObject from "./UpObject.svelte";
export let entry: UpEntry;
</script>
<div class="entry">
<div class="entity">
<UpObject address={entry.entity} />
</div>
<div class="attribute">
{entry.attribute}
</div>
<div class="value value-{entry.value.t.toLowerCase()}">
{#if entry.value.t === "Address"}
<UpObject address={String(entry.value.c)} />
{:else}
{entry.value.c}
{/if}
</div>
</div>
<style lang="scss">
.entry {
border: 1px solid var(--foreground);
border-radius: 4px;
padding: 0.5em;
display: flex;
align-content: center;
align-items: center;
gap: 1em;
& > * {
flex: 33%;
}
}
.attribute {
font-weight: bold;
flex-grow: 1;
text-align: center;
}
:global(.value-value) {
font-family: var(--monospace-font);
}
</style>

View File

@ -3,6 +3,7 @@
import debounce from "lodash/debounce";
import { Readable, readable } from "svelte/store";
import type { UpListing } from "upend";
import UpEntry from "../components/display/UpEntry.svelte";
export let query: string;
let debouncedQuery = "";
@ -22,10 +23,34 @@
<div>
{#if $result}
{#each $result.entries as entry}
{entry.toString()}
{:else}
No results.
{/each}
<section>
<h2>Objects</h2>
</section>
<section>
<h2>Raw results</h2>
<ul>
{#each $result.entries as entry}
<li><UpEntry {entry} /></li>
{:else}
<li>No results.</li>
{/each}
</ul>
</section>
{/if}
</div>
<style lang="scss">
h2 {
text-align: center;
}
ul {
list-style: none;
margin: 0;
}
li {
margin: 1em auto;
width: 66em;
}
</style>