Icon route added

This commit is contained in:
2023-07-03 12:39:34 +02:00
parent f218d81cf1
commit 73c1d13c37
12 changed files with 205 additions and 27 deletions
@@ -0,0 +1,17 @@
<script lang="ts">
import type { PageData } from './$types';
import Recipes from '$lib/components/Recipes.svelte';
import IconLayout from '$lib/components/IconLayout.svelte';
import MediaScroller from '$lib/components/MediaScroller.svelte';
import Card from '$lib/components/Card.svelte';
import Search from '$lib/components/Search.svelte';
export let data: PageData;
</script>
<IconLayout icons={data.icons}>
<h2 slot=test>Rezepte mit {data.icon}</h2>
<Recipes slot=recipes>
{#each data.season as recipe}
<Card {recipe} icon_override=true></Card>
{/each}
</Recipes>
</IconLayout>
+13
View File
@@ -0,0 +1,13 @@
import type { PageLoad } from "./$types";
export async function load({ fetch, params }) {
const res_season = await fetch(`/api/items/icon/` + params.icon);
const res_icons = await fetch(`/api/items/icon`);
const icons = await res_icons.json();
const item_season = await res_season.json();
return {
icons: icons,
icon: params.icon,
season: item_season,
};
};