From 5e111fbc7a6b275436d6a0c22b6734e9288e5190 Mon Sep 17 00:00:00 2001 From: WalidMoovin Date: Thu, 16 Mar 2023 02:36:35 +0100 Subject: [PATCH] Front reformat / error fixing / passing channel prop to chat component --- front/volume/src/App.svelte | 1 + front/volume/src/components/Channels.svelte | 86 ++++---- front/volume/src/components/Chat.svelte | 209 ++++++++------------ front/volume/src/components/NavBar.svelte | 8 +- 4 files changed, 125 insertions(+), 179 deletions(-) diff --git a/front/volume/src/App.svelte b/front/volume/src/App.svelte index 00a65cf..42ddeff 100644 --- a/front/volume/src/App.svelte +++ b/front/volume/src/App.svelte @@ -136,6 +136,7 @@ on:keydown={() => setAppState(APPSTATE.CHANNELS)} > - export interface ChannelsType { id: number; name: string; @@ -10,8 +9,6 @@ import { onMount } from "svelte"; import { API_URL, store } from "../Auth"; import { io } from "../socket"; - import Select from 'svelte-select'; - -
-
-
- { #each chatMessages as message } -

- { #if !blockedUsers.filter((user) => user.username == message.author).length } - openProfile(message.author)} - on:keydown = {() => openProfile(message.author)} - style = "cursor: pointer;" - > - { message.author } - : {message.text} -{ - /if} -

- { - /each} -
- { #if showProfileMenu } -
-
    -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • - -
  • -
  • -{ #if !blockedUsers.filter((user) => user.username = selectedUser).length } - -{:else } - -{ - /if} -
  • -
  • -
-
- { - /if} -
- - -
- - { #if showChatMembers } -
-
-
    - { #each chatMembers as member } -
  • -

    - { member.username } - - - - - -

    -

    ------------------------------------------------------------------------------------ -

    -
  • -{ - /each} -
-
-
- { - /if} -
-
+ +
+
+
+ { #each chatMessages as message } +

+ { #if !blockedUsers.filter((user) => user.username == message.author).length } + openProfile(message.author)} + on:keydown = {() => openProfile(message.author)} + style = "cursor: pointer;" + > + { message.author } + : {message.text} + {/if} +

+ {/each} +
+ { #if showProfileMenu } +
+
    +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + +
  • +
  • + { #if !blockedUsers.filter((user) => user.username = selectedUser).length } + + {:else } + + {/if} +
  • +
  • +
+
+ {/if} +
+ + +
+ + { #if showChatMembers } +
+
+
    + { #each chatMembers as member } +
  • +

    + { member.username } + + + + + +

    +
  • + {/each} +
+ {/if} +
+
diff --git a/front/volume/src/components/NavBar.svelte b/front/volume/src/components/NavBar.svelte index 54c8288..a734317 100644 --- a/front/volume/src/components/NavBar.svelte +++ b/front/volume/src/components/NavBar.svelte @@ -1,9 +1,6 @@