From 1109adb6a58b75b6a3f082a7aceda9b4402ab64e Mon Sep 17 00:00:00 2001 From: Martti Malmi Date: Wed, 26 Jul 2023 16:53:50 +0300 Subject: [PATCH] hide search column in chat view --- src/js/views/View.tsx | 12 ++++++++---- src/js/views/chat/Chat.tsx | 1 + src/js/views/chat/ChatList.tsx | 4 ++-- src/js/views/chat/ChatListItem.tsx | 2 +- 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/src/js/views/View.tsx b/src/js/views/View.tsx index f01fa1fb..a99b7836 100644 --- a/src/js/views/View.tsx +++ b/src/js/views/View.tsx @@ -4,6 +4,7 @@ import { JSX } from 'preact'; import Component from '../BaseComponent'; import ErrorBoundary from '../components/ErrorBoundary'; import Header from '../components/Header'; +import Show from '../components/helpers/Show'; import Search from './Search'; @@ -19,21 +20,24 @@ abstract class View extends Component { id = ''; observer: ResizeObserver | null = null; scrollPosition = 0; + hideSideBar = false; abstract renderView(): JSX.Element; render() { return (
-
+
{this.renderView()}
-
- -
+ +
+ +
+
); } diff --git a/src/js/views/chat/Chat.tsx b/src/js/views/chat/Chat.tsx index 374d123e..8ab400db 100644 --- a/src/js/views/chat/Chat.tsx +++ b/src/js/views/chat/Chat.tsx @@ -9,6 +9,7 @@ class Chat extends View { constructor() { super(); this.id = 'chat-view'; + this.hideSideBar = true; } renderView() { diff --git a/src/js/views/chat/ChatList.tsx b/src/js/views/chat/ChatList.tsx index 94a54322..18f2f9c8 100644 --- a/src/js/views/chat/ChatList.tsx +++ b/src/js/views/chat/ChatList.tsx @@ -72,7 +72,7 @@ class ChatList extends BaseComponent { return (
@@ -86,7 +86,7 @@ class ChatList extends BaseComponent { {t('turn_on_desktop_notifications')}
-
+
{this.state.sortedChats.map((pubkey) => ( { onKeyUp={(e: KeyboardEvent) => this.onKeyUp(e)} role="button" tabIndex={0} - className={`flex flex-row gap-2 ${hasUnseen} ${active}`} + className={`flex flex-row gap-4 ${hasUnseen} ${active}`} onClick={() => route(`/chat/${npub}`)} >