Minor chats styles improvements
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
parent
a0597a6445
commit
37b698b2e0
|
@ -259,6 +259,7 @@ export interface IDropdown extends RouteComponentProps {
|
||||||
text?: string,
|
text?: string,
|
||||||
onShiftClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>,
|
onShiftClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>,
|
||||||
children?: JSX.Element,
|
children?: JSX.Element,
|
||||||
|
dropdownMenuStyle?: React.CSSProperties,
|
||||||
}
|
}
|
||||||
|
|
||||||
interface IDropdownState {
|
interface IDropdownState {
|
||||||
|
@ -369,7 +370,7 @@ class Dropdown extends React.PureComponent<IDropdown, IDropdownState> {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
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;
|
const open = this.state.id === openDropdownId;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -403,7 +404,7 @@ class Dropdown extends React.PureComponent<IDropdown, IDropdownState> {
|
||||||
)}
|
)}
|
||||||
|
|
||||||
<Overlay show={open} placement={dropdownPlacement} target={this.findTarget}>
|
<Overlay show={open} placement={dropdownPlacement} target={this.findTarget}>
|
||||||
<RouterDropdownMenu items={items} onClose={this.handleClose} openedViaKeyboard={openedViaKeyboard} />
|
<RouterDropdownMenu items={items} onClose={this.handleClose} openedViaKeyboard={openedViaKeyboard} style={dropdownMenuStyle} />
|
||||||
</Overlay>
|
</Overlay>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
import classNames from 'clsx';
|
import classNames from 'clsx';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
|
||||||
interface ITextarea extends Pick<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'maxLength' | 'onChange' | 'required' | 'disabled' | 'rows' | 'readOnly'> {
|
interface ITextarea extends Pick<React.TextareaHTMLAttributes<HTMLTextAreaElement>, 'maxLength' | 'onChange' | 'required' | 'disabled' | 'rows' | 'readOnly' | 'onKeyDown' | 'onPaste'> {
|
||||||
/** Put the cursor into the input on mount. */
|
/** Put the cursor into the input on mount. */
|
||||||
autoFocus?: boolean,
|
autoFocus?: boolean,
|
||||||
/** The initial text in the input. */
|
/** The initial text in the input. */
|
||||||
|
|
|
@ -8,6 +8,7 @@ import {
|
||||||
} from 'soapbox/actions/chats';
|
} from 'soapbox/actions/chats';
|
||||||
import { uploadMedia } from 'soapbox/actions/media';
|
import { uploadMedia } from 'soapbox/actions/media';
|
||||||
import IconButton from 'soapbox/components/icon-button';
|
import IconButton from 'soapbox/components/icon-button';
|
||||||
|
import { Textarea } from 'soapbox/components/ui';
|
||||||
import UploadProgress from 'soapbox/components/upload-progress';
|
import UploadProgress from 'soapbox/components/upload-progress';
|
||||||
import UploadButton from 'soapbox/features/compose/components/upload-button';
|
import UploadButton from 'soapbox/features/compose/components/upload-button';
|
||||||
import { useAppSelector, useAppDispatch } from 'soapbox/hooks';
|
import { useAppSelector, useAppDispatch } from 'soapbox/hooks';
|
||||||
|
@ -179,11 +180,11 @@ const ChatBox: React.FC<IChatBox> = ({ chatId, onSetInputRef, autosize }) => {
|
||||||
{isUploading && (
|
{isUploading && (
|
||||||
<UploadProgress progress={uploadProgress * 100} />
|
<UploadProgress progress={uploadProgress * 100} />
|
||||||
)}
|
)}
|
||||||
<div className='chat-box__actions simple_form'>
|
<div className='chat-box__actions'>
|
||||||
<div className='chat-box__send'>
|
<div className='chat-box__send'>
|
||||||
{renderActionButton()}
|
{renderActionButton()}
|
||||||
</div>
|
</div>
|
||||||
<textarea
|
<Textarea
|
||||||
rows={1}
|
rows={1}
|
||||||
placeholder={intl.formatMessage(messages.placeholder)}
|
placeholder={intl.formatMessage(messages.placeholder)}
|
||||||
onKeyDown={handleKeyDown}
|
onKeyDown={handleKeyDown}
|
||||||
|
|
|
@ -254,6 +254,7 @@ const ChatMessageList: React.FC<IChatMessageList> = ({ chatId, chatMessageIds, a
|
||||||
items={menu}
|
items={menu}
|
||||||
src={require('@tabler/icons/dots.svg')}
|
src={require('@tabler/icons/dots.svg')}
|
||||||
title={intl.formatMessage(messages.more)}
|
title={intl.formatMessage(messages.more)}
|
||||||
|
dropdownMenuStyle={{ zIndex: 1000 }}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -68,7 +68,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&__content {
|
&__content {
|
||||||
@apply flex flex-1 flex-col overflow-hidden bg-white dark:bg-gray-800;
|
@apply flex flex-1 flex-col overflow-hidden bg-white dark:bg-gray-900;
|
||||||
|
|
||||||
> div {
|
> div {
|
||||||
@apply max-h-full;
|
@apply max-h-full;
|
||||||
|
@ -92,7 +92,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
.audio-toggle .react-toggle-track {
|
.audio-toggle .react-toggle-track {
|
||||||
@apply h-4 w-8 bg-accent-500;
|
@apply h-4 w-8 bg-accent-500 dark:bg-accent-500;
|
||||||
}
|
}
|
||||||
|
|
||||||
.audio-toggle .react-toggle-track-check {
|
.audio-toggle .react-toggle-track-check {
|
||||||
|
@ -112,6 +112,10 @@
|
||||||
.fa {
|
.fa {
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.chat-message--me .chat-message__bubble {
|
||||||
|
@apply dark:bg-primary-900;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.chat-messages {
|
.chat-messages {
|
||||||
|
@ -155,7 +159,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
&--me .chat-message__bubble {
|
&--me .chat-message__bubble {
|
||||||
@apply bg-primary-200 dark:bg-primary-900;
|
@apply bg-primary-200 dark:bg-primary-800;
|
||||||
margin-left: auto;
|
margin-left: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,15 +173,16 @@
|
||||||
right: -8px;
|
right: -8px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
padding: 1px;
|
padding: 1px;
|
||||||
background: var(--background-color);
|
|
||||||
border-radius: 999px;
|
|
||||||
opacity: 0;
|
opacity: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
transition: 0.2s;
|
transition: 0.2s;
|
||||||
|
|
||||||
.svg-icon {
|
button {
|
||||||
height: 20px;
|
@apply p-1 bg-gray-100 dark:bg-gray-800;
|
||||||
width: 20px;
|
|
||||||
|
svg {
|
||||||
|
@apply h-4 w-4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -250,29 +255,17 @@
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
textarea {
|
textarea {
|
||||||
width: 100%;
|
@apply pr-6;
|
||||||
height: 100%;
|
|
||||||
margin: 0;
|
|
||||||
box-sizing: border-box;
|
|
||||||
padding: 6px;
|
|
||||||
padding-right: 25px;
|
|
||||||
background: var(--background-color);
|
|
||||||
border: 0;
|
|
||||||
border-radius: 6px;
|
|
||||||
color: var(--primary-text-color);
|
|
||||||
font-size: 15px;
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
&__send {
|
&__send {
|
||||||
.icon-button,
|
.icon-button,
|
||||||
button {
|
button {
|
||||||
@apply absolute right-2.5 w-auto h-auto border-0 p-0 m-0 text-black dark:text-white;
|
@apply absolute right-2.5 w-auto h-auto border-0 p-0 m-0 bg-transparent text-black dark:text-white;
|
||||||
top: 50%;
|
top: 50%;
|
||||||
transform: translateY(-50%);
|
transform: translateY(-50%);
|
||||||
|
|
||||||
.svg-icon,
|
|
||||||
svg {
|
svg {
|
||||||
@apply w-[18px] h-[18px];
|
@apply w-[18px] h-[18px];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue