From 37b698b2e032f264eff54c289f8c0191006b42dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?marcin=20miko=C5=82ajczak?= Date: Thu, 24 Nov 2022 23:15:30 +0100 Subject: [PATCH] Minor chats styles improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: marcin mikołajczak --- app/soapbox/components/dropdown-menu.tsx | 5 ++- .../components/ui/textarea/textarea.tsx | 2 +- .../features/chats/components/chat-box.tsx | 5 ++- .../chats/components/chat-message-list.tsx | 1 + app/styles/chats.scss | 37 ++++++++----------- 5 files changed, 23 insertions(+), 27 deletions(-) diff --git a/app/soapbox/components/dropdown-menu.tsx b/app/soapbox/components/dropdown-menu.tsx index 77be0f18d..807e94997 100644 --- a/app/soapbox/components/dropdown-menu.tsx +++ b/app/soapbox/components/dropdown-menu.tsx @@ -259,6 +259,7 @@ export interface IDropdown extends RouteComponentProps { text?: string, onShiftClick?: React.EventHandler, children?: JSX.Element, + dropdownMenuStyle?: React.CSSProperties, } interface IDropdownState { @@ -369,7 +370,7 @@ class Dropdown extends React.PureComponent { } render() { - const { src = require('@tabler/icons/dots.svg'), items, title, disabled, dropdownPlacement, openDropdownId, openedViaKeyboard = false, pressed, text, children } = this.props; + const { src = require('@tabler/icons/dots.svg'), items, title, disabled, dropdownPlacement, openDropdownId, openedViaKeyboard = false, pressed, text, children, dropdownMenuStyle } = this.props; const open = this.state.id === openDropdownId; return ( @@ -403,7 +404,7 @@ class Dropdown extends React.PureComponent { )} - + ); diff --git a/app/soapbox/components/ui/textarea/textarea.tsx b/app/soapbox/components/ui/textarea/textarea.tsx index c1bbe0ee4..e9788a069 100644 --- a/app/soapbox/components/ui/textarea/textarea.tsx +++ b/app/soapbox/components/ui/textarea/textarea.tsx @@ -1,7 +1,7 @@ import classNames from 'clsx'; import React from 'react'; -interface ITextarea extends Pick, 'maxLength' | 'onChange' | 'required' | 'disabled' | 'rows' | 'readOnly'> { +interface ITextarea extends Pick, 'maxLength' | 'onChange' | 'required' | 'disabled' | 'rows' | 'readOnly' | 'onKeyDown' | 'onPaste'> { /** Put the cursor into the input on mount. */ autoFocus?: boolean, /** The initial text in the input. */ diff --git a/app/soapbox/features/chats/components/chat-box.tsx b/app/soapbox/features/chats/components/chat-box.tsx index de97cd45a..38ef43c74 100644 --- a/app/soapbox/features/chats/components/chat-box.tsx +++ b/app/soapbox/features/chats/components/chat-box.tsx @@ -8,6 +8,7 @@ import { } from 'soapbox/actions/chats'; import { uploadMedia } from 'soapbox/actions/media'; import IconButton from 'soapbox/components/icon-button'; +import { Textarea } from 'soapbox/components/ui'; import UploadProgress from 'soapbox/components/upload-progress'; import UploadButton from 'soapbox/features/compose/components/upload-button'; import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; @@ -179,11 +180,11 @@ const ChatBox: React.FC = ({ chatId, onSetInputRef, autosize }) => { {isUploading && ( )} -
+
{renderActionButton()}
-