This commit is contained in:
parent
a7f9940ab1
commit
40277e3380
3 changed files with 9 additions and 8 deletions
|
@ -9,10 +9,6 @@
|
||||||
|
|
||||||
let ref: HTMLDivElement;
|
let ref: HTMLDivElement;
|
||||||
let component = InfoTab;
|
let component = InfoTab;
|
||||||
onMount(() => {
|
|
||||||
const gbcr = ref.getBoundingClientRect();
|
|
||||||
ref.style.height = `${gbcr.height}px`;
|
|
||||||
});
|
|
||||||
|
|
||||||
const activeClicked = (evt) => {
|
const activeClicked = (evt) => {
|
||||||
const clickedTab = evt.target.closest('button');
|
const clickedTab = evt.target.closest('button');
|
||||||
|
@ -35,7 +31,7 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
dispatch('map-click', { component });
|
dispatch('tab-click', { component });
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { onMount, onDestroy } from 'svelte';
|
import { onMount, onDestroy } from 'svelte';
|
||||||
import { fade, fly } from 'svelte/transition';
|
import { fade } from 'svelte/transition';
|
||||||
|
|
||||||
export let route;
|
export let route;
|
||||||
const pianelloCoordinates = [43.14, 12.53];
|
const pianelloCoordinates = [43.14, 12.53];
|
||||||
|
|
|
@ -1,12 +1,17 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import Header from '$lib/components/Header.svelte';
|
import Header from '$lib/components/Header.svelte';
|
||||||
import Tabs from '$lib/components/Tabs.svelte';
|
import Tabs from '$lib/components/Tabs.svelte';
|
||||||
|
import MapTab from '$lib/components/tabs/MapTab.svelte';
|
||||||
|
|
||||||
export let data: App.Route;
|
export let data: App.Route;
|
||||||
|
|
||||||
let divider;
|
let divider;
|
||||||
|
|
||||||
const mapClick = () => {};
|
const tabClick = (event) => {
|
||||||
|
if (event.detail.component === MapTab) {
|
||||||
|
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<Header></Header>
|
<Header></Header>
|
||||||
|
@ -17,7 +22,7 @@
|
||||||
<p class='path-name'>Percorso <b>{data.name_it}</b></p>
|
<p class='path-name'>Percorso <b>{data.name_it}</b></p>
|
||||||
<p id="duration">Dislivello {data?.route_sport_details[0]?.elevation_gain} m</p>
|
<p id="duration">Dislivello {data?.route_sport_details[0]?.elevation_gain} m</p>
|
||||||
</div>
|
</div>
|
||||||
<Tabs on:map-click={mapClick} route={data}></Tabs>
|
<Tabs on:tab-click={tabClick} route={data}></Tabs>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
Loading…
Reference in a new issue