From 9924597f9f1c8f8a6f22ea1a13ee282746a3eed9 Mon Sep 17 00:00:00 2001 From: Gagan Suie Date: Thu, 2 Feb 2023 03:41:18 -0600 Subject: [PATCH 1/3] Fx: smallDrawer and chat message theming --- src/hooks.server.ts | 12 +--- src/lib/components/Chat/ChatDrawer.svelte | 13 ++-- src/lib/components/Chat/ChatMessage.svelte | 65 ++++++++++------- .../components/Chat/ChatProfileCard.svelte | 48 +++++++++++++ src/lib/stores/helperStore.ts | 2 - src/lib/stores/socketStore.ts | 70 +++++++++---------- src/routes/+layout.svelte | 7 +- .../channel/[channelId]/+page.server.ts | 2 + 8 files changed, 138 insertions(+), 81 deletions(-) create mode 100644 src/lib/components/Chat/ChatProfileCard.svelte diff --git a/src/hooks.server.ts b/src/hooks.server.ts index c3161c39..d5519c74 100644 --- a/src/hooks.server.ts +++ b/src/hooks.server.ts @@ -6,11 +6,7 @@ import { getRemoteConfigs, isMaintenanceModeEnabled } from '$lib/stores/remoteCo import { Authenticate } from '$lib/authentication/authentication' import type { Handle } from '@sveltejs/kit' import { env } from '$env/dynamic/public' -import { - isChannelPage, - userId as userIdWritable, - token as tokenWritable -} from '$lib/stores/helperStore' +import { userId as userIdWritable, token as tokenWritable } from '$lib/stores/helperStore' export const handle: Handle = async ({ event, resolve }) => { const pathname = event.url.pathname @@ -113,12 +109,6 @@ export const handle: Handle = async ({ event, resolve }) => { throw redirect(302, '/maintenance') } } else { - console.log('pathname', pathname) - if (pathname.includes('/channel')) { - isChannelPage.set(false) - } else { - isChannelPage.set(false) - } return await resolve(event) } } diff --git a/src/lib/components/Chat/ChatDrawer.svelte b/src/lib/components/Chat/ChatDrawer.svelte index 5306b1fc..4c3d0561 100644 --- a/src/lib/components/Chat/ChatDrawer.svelte +++ b/src/lib/components/Chat/ChatDrawer.svelte @@ -8,13 +8,12 @@ let username = 'Gagan', message = - 'Hello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello World' - - let sender = { username, message } - - let youSender = { username: 'Singh', message: 'hewrewrwe ehe' } - let modSender = { username: 'Moderator', message: 'hewe rew rwe rwhe' } - let otherSender = { username: 'Randos', message: 'he wer wer wehe' } + 'Hello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello WorldHello World', + role = 'Host' + let sender = { username, message, role } + let youSender = { username: 'Singh', message: 'hewrewrwe ehe', role: 'You' } + let modSender = { username: 'Simmi', message: 'hewe rew rwe rwhe', role: 'Mod' } + let otherSender = { username: 'Arjan', message: 'he wer wer wehe', role: 'Rando' } onMount(async () => { // if (!$tags.length) { diff --git a/src/lib/components/Chat/ChatMessage.svelte b/src/lib/components/Chat/ChatMessage.svelte index e0a5a60d..51246dba 100644 --- a/src/lib/components/Chat/ChatMessage.svelte +++ b/src/lib/components/Chat/ChatMessage.svelte @@ -1,43 +1,60 @@ + +