From 78fa15b6317908142aa35bdc4a88c55d44936ce8 Mon Sep 17 00:00:00 2001 From: WalidMoovin Date: Tue, 14 Feb 2023 16:53:05 +0100 Subject: [PATCH] hard coded all, but added match history --- src/App.svelte | 20 +++++++---- src/components/MatchHistory.svelte | 57 ++++++++++++++++++++---------- src/components/NavBar.svelte | 24 +++++++++---- 3 files changed, 68 insertions(+), 33 deletions(-) diff --git a/src/App.svelte b/src/App.svelte index fcd4880..e8ef384 100644 --- a/src/App.svelte +++ b/src/App.svelte @@ -2,25 +2,31 @@ import Navbar from './components/NavBar.svelte'; import Profile from './components/Profile.svelte'; import MatchHistory from './components/MatchHistory.svelte'; - const matches = [ - { winner: 'Alice', loser: 'Bob', time: new Date('2023-02-13T15:30:00Z') }, - { winner: 'Charlie', loser: 'David', time: new Date('2023-02-12T18:45:00Z') }, - { winner: 'Alice', loser: 'Charlie', time: new Date('2023-02-11T21:15:00Z') }, - ] let isProfileOpen = false; function clickProfile() { isProfileOpen = true; } + let isHistoryOpen = false; + function clickHistory() { + isHistoryOpen = true; + } + let matches = [ + {winner : "Alice", loser : "Bob"}, + ]
- + + {#if isHistoryOpen} +
isHistoryOpen = false} on:keydown={() => isHistoryOpen = false}> + +
+ {/if} {#if isProfileOpen}
isProfileOpen = false} on:keydown={() => isProfileOpen = false}>
{/if} -
\ No newline at end of file diff --git a/src/components/NavBar.svelte b/src/components/NavBar.svelte index 431a193..075ec15 100644 --- a/src/components/NavBar.svelte +++ b/src/components/NavBar.svelte @@ -8,18 +8,28 @@ { text: "Profile", url: "/Profile" } ]; export let clickProfile; + export let clickHistory;