Skip to content

Commit c408da6

Browse files
committed
Implemented the home button
1 parent 4876ed8 commit c408da6

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/lib/layout/StatsView.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
import ArtistList from "$lib/comp/ArtistList.svelte";
33
import PageContainer from "$lib/comp/PageContainer.svelte";
44
import SongList from "$lib/comp/SongList.svelte";
5-
import SongView from "$lib/comp/SongView.svelte";
65
import LinkButton from "$lib/LinkButton.svelte";
76
import type { Stats } from "$lib/stats";
87
98
export let stats: Stats;
9+
export let onClose: () => any = () => console.warn("onClose not set")
1010
1111
let currentPage = 0;
1212
const pageCount = 4;
@@ -72,7 +72,7 @@
7272
<h1>That's all, see you again!</h1>
7373

7474
<div style="text-align: center;">
75-
<LinkButton text="Home page" />
75+
<LinkButton text="Home page" onClick={onClose} />
7676
</div>
7777
{/snippet}
7878

src/routes/+page.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
88
let currentStats: Stats | null = null;
99
10-
function setStats(stats: Stats) {
10+
function setStats(stats: Stats | null) {
1111
currentStats = stats;
1212
}
1313
</script>
1414

1515
<Page>
1616
{#if currentStats}
17-
<StatsView stats={currentStats} />
17+
<StatsView stats={currentStats} onClose={() => setStats(null)} />
1818
{:else}
1919
<Home setStats={setStats}/>
2020
{/if}

0 commit comments

Comments
 (0)