Start work on share tab
This commit is contained in:
parent
df9dd7f32a
commit
deea258220
@ -24,7 +24,7 @@ placeholder="Enter address"></Svelecte>
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="mb-4">
|
<div class="mb-4">
|
||||||
<label class="text-gray-700 text-sm font-bold mb-2" for="username">Address</label>
|
<label class="text-gray-700 text-sm font-bold mb-2" for="username">xpin Address</label>
|
||||||
<input
|
<input
|
||||||
class="shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-96"
|
class="shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-96"
|
||||||
type="text"
|
type="text"
|
||||||
|
@ -26,7 +26,7 @@
|
|||||||
</select>
|
</select>
|
||||||
</label>
|
</label>
|
||||||
<input
|
<input
|
||||||
class="shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-full"
|
class="shadow appearance-none border rounded py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline w-96"
|
||||||
type="text"
|
type="text"
|
||||||
bind:value
|
bind:value
|
||||||
placeholder="0.00"
|
placeholder="0.00"
|
||||||
|
@ -6,8 +6,24 @@
|
|||||||
import CoordinateInput from '$lib/CoordinateInput.svelte';
|
import CoordinateInput from '$lib/CoordinateInput.svelte';
|
||||||
import { browser } from '$app/environment';
|
import { browser } from '$app/environment';
|
||||||
import Error from './Error.svelte';
|
import Error from './Error.svelte';
|
||||||
|
import TabSelector from './TabSelector.svelte';
|
||||||
|
import CoordinateInfo from './CoordinateInfo.svelte';
|
||||||
import { emptyxpin } from '$lib/common.js';
|
import { emptyxpin } from '$lib/common.js';
|
||||||
|
|
||||||
|
let tabInfo = {
|
||||||
|
selected: 0,
|
||||||
|
tabs: [
|
||||||
|
{
|
||||||
|
label: "Map",
|
||||||
|
idx: 0,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: "Share",
|
||||||
|
idx: 1,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
|
||||||
let initSuccess = false;
|
let initSuccess = false;
|
||||||
let coordinateTypes = [];
|
let coordinateTypes = [];
|
||||||
let selectedCoordinateType;
|
let selectedCoordinateType;
|
||||||
@ -158,9 +174,6 @@
|
|||||||
{#await init()}
|
{#await init()}
|
||||||
<p class="text-lg js-only">Loading WebAssembly module...</p>
|
<p class="text-lg js-only">Loading WebAssembly module...</p>
|
||||||
{:then}
|
{:then}
|
||||||
<p>Address: <span class="font-bold">{addr.address}</span></p>
|
|
||||||
<p class="text-sm">({addr.latLon}) => ({addr.latLon})</p>
|
|
||||||
|
|
||||||
<AddressInput bind:value={addrInputValue} on:change={addressInput} />
|
<AddressInput bind:value={addrInputValue} on:change={addressInput} />
|
||||||
|
|
||||||
<CoordinateInput
|
<CoordinateInput
|
||||||
@ -170,10 +183,17 @@
|
|||||||
bind:coordinateTypes
|
bind:coordinateTypes
|
||||||
bind:selectedCoordinateType
|
bind:selectedCoordinateType
|
||||||
/>
|
/>
|
||||||
|
|
||||||
|
<TabSelector bind:tabInfo />
|
||||||
|
|
||||||
|
{#if tabInfo.selected === 1}
|
||||||
|
<CoordinateInfo bind:xpin={addr} />
|
||||||
|
{/if}
|
||||||
|
|
||||||
{:catch message}
|
{:catch message}
|
||||||
<Error {message}>Could not start core module</Error>
|
<Error {message}>Could not start core module</Error>
|
||||||
{/await}
|
{/await}
|
||||||
|
|
||||||
<span class:invisible={!initSuccess}>
|
<span class:invisible={!initSuccess || tabInfo.selected !== 0}>
|
||||||
<Map bind:map {onMapClick} on:locationfound={locationfound} />
|
<Map bind:map {onMapClick} on:locationfound={locationfound} />
|
||||||
</span>
|
</span>
|
||||||
|
5
web-frontend/src/routes/app/CoordinateInfo.svelte
Normal file
5
web-frontend/src/routes/app/CoordinateInfo.svelte
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
<script>
|
||||||
|
export let xpin;
|
||||||
|
</script>
|
||||||
|
|
||||||
|
Hi there
|
14
web-frontend/src/routes/app/TabSelector.svelte
Normal file
14
web-frontend/src/routes/app/TabSelector.svelte
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
<script>
|
||||||
|
export let tabInfo;
|
||||||
|
|
||||||
|
const updateSelectedTab = (tab) => {
|
||||||
|
tabInfo.selected = tab.idx;
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<ul class="flex">
|
||||||
|
{#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>
|
||||||
|
{/each}
|
||||||
|
</ul>
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user