From b4c8a49dab7e6b226e3fd9a21d02b3980c383e09 Mon Sep 17 00:00:00 2001 From: WalidMoovin Date: Mon, 13 Mar 2023 18:21:42 +0100 Subject: [PATCH] chat --- front/volume/src/App.svelte | 13 +- front/volume/src/components/Channels.svelte | 9 +- front/volume/src/components/Chat.svelte | 178 +++++++++++++++++--- 3 files changed, 165 insertions(+), 35 deletions(-) diff --git a/front/volume/src/App.svelte b/front/volume/src/App.svelte index 6290326..dec61c1 100644 --- a/front/volume/src/App.svelte +++ b/front/volume/src/App.svelte @@ -86,17 +86,7 @@ function clickChannels() { setAppState(APPSTATE.CHANNELS); } - let channels: Array = [ - { id: "1", name: "General", messages: [], privacy: "public", password: "" }, - { - id: "2", - name: "Lobby", - messages: [], - privacy: "private", - password: "test", - }, - { id: "3", name: "Game", messages: [], privacy: "private", password: "" }, - ]; + let channels: Array = []; let selectedChannel: ChannelsType; const handleSelectChannel = (channel: ChannelsType) => { selectedChannel = channel; @@ -151,7 +141,6 @@ on:keydown={() => setAppState(APPSTATE.CHANNELS)} > ; + owner: string; } import { onMount } from "svelte"; import { API_URL, store } from "../Auth"; - import { dataset_dev } from "svelte/internal"; + import { dataset_dev } from "svelte/internal";
@@ -138,7 +245,8 @@ >
  • -
  • @@ -168,17 +276,35 @@
  • {member.username} - - - - -

    + + + + + +

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

  • {/each}
    {/if} + + {#if showChannelSettings} +
    +
    + + + +
    +
    + {/if} @@ -225,6 +351,20 @@ } .chatMembers button { - width: 3.5rem; + width: 6rem; + } + + .channelSettings { + position: absolute; + background-color: #fff; + border: 1px solid #ccc; + border-radius: 5px; + padding: 1rem; + max-height: 100px; + overflow-y: scroll; + } + + .channelSettings button { + width: 5rem; }