From d3f011b3f03070d8e39c4312c5fffca7f8255465 Mon Sep 17 00:00:00 2001 From: WalidMoovin Date: Mon, 6 Mar 2023 15:32:53 +0100 Subject: [PATCH] x --- back/volume/src/types.d.ts | 2 +- front/volume/src/App.svelte | 17 ++++++ front/volume/src/components/Chat2.svelte | 50 ++++++++++------- .../volume/src/components/Leaderboard.svelte | 54 +++++++++++++++++++ front/volume/src/components/NavBar.svelte | 9 ++++ 5 files changed, 112 insertions(+), 20 deletions(-) create mode 100644 front/volume/src/components/Leaderboard.svelte diff --git a/back/volume/src/types.d.ts b/back/volume/src/types.d.ts index 0f5d664..afe5375 100644 --- a/back/volume/src/types.d.ts +++ b/back/volume/src/types.d.ts @@ -1,5 +1,5 @@ declare module 'passport-42' { export type Profile = any export type VerifyCallback = any - export class Strategy {}! + export class Strategy {} } diff --git a/front/volume/src/App.svelte b/front/volume/src/App.svelte index c341147..61c72d3 100644 --- a/front/volume/src/App.svelte +++ b/front/volume/src/App.svelte @@ -12,6 +12,7 @@ import Chat2 from "./components/Chat2.svelte"; import Channels from "./components/Channels.svelte"; import type { ChannelsType } from "./components/Channels.svelte"; + import Leaderboard from "./components/Leaderboard.svelte"; import { store, getUser, login, logout, API_URL } from "./Auth"; @@ -110,6 +111,13 @@ const handleSelectChannel = (channel: ChannelsType) => { selectedChannel = channel; }; + + // LEADERBOARD + let isLeaderboardOpen = false; + function clickLeaderboard() { + isLeaderboardOpen = true; + } +
@@ -123,6 +131,7 @@ {clickFriends} {clickSpectate} {clickChannels} + {clickLeaderboard} /> {#if isChannelsOpen} {#if selectedChannel} @@ -150,6 +159,14 @@ {/if} + {#if isLeaderboardOpen} +
(isLeaderboardOpen = false)} + on:keydown={() => (isLeaderboardOpen = false)} + > + +
+ {/if} {#if isFriendOpen}
{ diff --git a/front/volume/src/components/Chat2.svelte b/front/volume/src/components/Chat2.svelte index 8897a1f..75487e0 100644 --- a/front/volume/src/components/Chat2.svelte +++ b/front/volume/src/components/Chat2.svelte @@ -4,6 +4,7 @@ name: string; text: string; } + import { createEventDispatcher, onMount } from "svelte";
@@ -64,6 +58,24 @@

{/each}
+ {#if showProfileMenu} +
+
    + +
  • +
  • +
  • +
  • +
  • +
  • +
+
+ {/if}
+ + {/if} {#if link.text === "Spectate"}