Fix route slug

This commit is contained in:
Alessio Davoli 2023-11-27 05:30:25 +01:00
parent 33bbf50a2d
commit 0143a16042
2 changed files with 57 additions and 48 deletions

View file

@ -1,28 +1,30 @@
<script lang="ts">
import Header from '$lib/components/Header.svelte';
import Tabs from '$lib/components/Tabs.svelte';
import MapTab from '$lib/components/tabs/MapTab.svelte';
import { onMount } from 'svelte';
export let data: App.Route;
export let data;
let divider;
const mapClick = (evt) => {
}
onMount(async () => {
console.log(data);
});
const mapClick = (evt) => {};
</script>
<Header></Header>
<img src='/images/splash-background.webp' alt='splash'>
<img src="/images/splash-background.webp" alt="splash" />
<div bind:this={divider} id='divider'>
<div id='banner'>
<p>Percorso <b>{data.name}</b></p>
<p id='duration'>Durata {Math.floor(Number(data.duration) / 60)}'</p>
<div bind:this={divider} id="divider">
<div id="banner">
<p>Percorso <b>{data.name_it}</b></p>
<p id="duration">Dislivello {data.elevation_gain}</p>
</div>
<Tabs on:map-click={mapClick}></Tabs>
<Tabs on:map-click={mapClick} route={data}></Tabs>
</div>
<style>
#divider {
background: white;

View file

@ -0,0 +1,7 @@
import { getRoute } from '$lib/repo.js';
import { error } from '@sveltejs/kit';
/** @type {import('./$types').PageLoad} */
export async function load({ params }) {
return await getRoute(params.slug);
}