diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-12-12 20:47:13 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2021-12-12 20:47:13 +0100 |
| commit | c0d27c055055f4aada0a96b779e0bd661347160c (patch) | |
| tree | 7fe4dea3b7328d7b15305f21e3e295405786ff88 /src/lib/components | |
| parent | da393520c4a1b33bffdfe26974e817f2c65267d3 (diff) | |
Port to svelte
Diffstat (limited to 'src/lib/components')
| -rw-r--r-- | src/lib/components/insult.svelte | 15 | ||||
| -rw-r--r-- | src/lib/components/new_insult.svelte | 18 |
2 files changed, 33 insertions, 0 deletions
diff --git a/src/lib/components/insult.svelte b/src/lib/components/insult.svelte new file mode 100644 index 0000000..61c17ec --- /dev/null +++ b/src/lib/components/insult.svelte @@ -0,0 +1,15 @@ +<script> + export let insult +</script> + +<article> + <header> + Eres un/a + </header> + <main> + {insult} + </main> + <footer> + <a href="/">Insulto nuevo.</a> + </footer> +</article> diff --git a/src/lib/components/new_insult.svelte b/src/lib/components/new_insult.svelte new file mode 100644 index 0000000..525741a --- /dev/null +++ b/src/lib/components/new_insult.svelte @@ -0,0 +1,18 @@ +<script> + import { getInsult } from '$lib/stores/insults'; + import { goto } from '$app/navigation'; + + $: insult = getInsult(); + + $: { + if ($insult) { + goto(`/${$insult}`); + } + } +</script> + +<article> + <main> + Insultando... + </main> +</article> |