This commit is contained in:
Bill 2022-03-16 17:46:07 -04:00
commit c27f4d7db1
4 changed files with 18 additions and 22 deletions

View File

@ -1,8 +1,9 @@
import { ChatRecordData, UserProfileComposer } from '@nitrots/nitro-renderer';
import { ChatRecordData } from '@nitrots/nitro-renderer';
import { CSSProperties, FC, Key, useCallback } from 'react';
import { AutoSizer, CellMeasurer, CellMeasurerCache, List, ListRowProps } from 'react-virtualized';
import { SendMessageComposer, TryVisitRoom } from '../../../../api';
import { TryVisitRoom } from '../../../../api';
import { Base, Button, Column, Flex, Grid, Text } from '../../../../common';
import { ModToolsOpenUserInfoEvent } from '../../../../events';
import { ModToolsOpenRoomInfoEvent } from '../../../../events/mod-tools/ModToolsOpenRoomInfoEvent';
import { DispatchUiEvent } from '../../../../hooks';
@ -29,7 +30,7 @@ export const ChatlogView: FC<ChatlogViewProps> = props =>
>
<Grid key={ props.key } fullHeight={ false } style={ props.style } gap={ 1 } alignItems="center" className="log-entry py-1 border-bottom">
<Text className="g-col-2">{ chatlogEntry.timestamp }</Text>
<Text className="g-col-3" bold underline pointer onClick={ event => SendMessageComposer(new UserProfileComposer(chatlogEntry.userId)) }>{ chatlogEntry.userName }</Text>
<Text className="g-col-3" bold underline pointer onClick={ event => DispatchUiEvent(new ModToolsOpenUserInfoEvent(chatlogEntry.userId)) }>{ chatlogEntry.userName }</Text>
<Text textBreak wrap className="g-col-7">{ chatlogEntry.message }</Text>
</Grid>
</CellMeasurer>
@ -79,7 +80,7 @@ export const ChatlogView: FC<ChatlogViewProps> = props =>
{ !isRoomInfo &&
<Grid key={ props.key } fullHeight={ false } style={ props.style } gap={ 1 } alignItems="center" className="log-entry py-1 border-bottom">
<Text className="g-col-2">{ chatlogEntry.timestamp }</Text>
<Text className="g-col-3" bold underline pointer onClick={ event => SendMessageComposer(new UserProfileComposer(chatlogEntry.userId)) }>{ chatlogEntry.userName }</Text>
<Text className="g-col-3" bold underline pointer onClick={ event => DispatchUiEvent(new ModToolsOpenUserInfoEvent(chatlogEntry.userId)) }>{ chatlogEntry.userName }</Text>
<Text textBreak wrap className="g-col-7">{ chatlogEntry.message }</Text>
</Grid> }
</CellMeasurer>

View File

@ -258,34 +258,34 @@ export const AvatarInfoWidgetOwnAvatarView: FC<AvatarInfoWidgetOwnAvatarViewProp
<ContextMenuListItemView onClick={ event => processAction('sign_10') }>
10
</ContextMenuListItemView>
<ContextMenuListItemView onClick={ event => processAction('sign_11') }>
<i className="icon icon-sign-heart" />
</ContextMenuListItemView>
<ContextMenuListItemView onClick={ event => processAction('sign_12') }>
<i className="icon icon-sign-skull" />
</ContextMenuListItemView>
</Flex>
<Flex className="menu-list-split-3">
<ContextMenuListItemView onClick={ event => processAction('sign_0') }>
0
</ContextMenuListItemView>
<ContextMenuListItemView onClick={ event => processAction('sign_13') }>
<i className="icon icon-sign-exclamation" />
</ContextMenuListItemView>
<ContextMenuListItemView onClick={ event => processAction('sign_15') }>
<i className="icon icon-sign-smile" />
</ContextMenuListItemView>
</Flex>
<Flex className="menu-list-split-3">
<ContextMenuListItemView onClick={ event => processAction('sign_12') }>
<i className="icon icon-sign-skull" />
</ContextMenuListItemView>
<ContextMenuListItemView onClick={ event => processAction('sign_14') }>
<i className="icon icon-sign-soccer" />
</ContextMenuListItemView>
<ContextMenuListItemView onClick={ event => processAction('sign_17') }>
<i className="icon icon-sign-yellow" />
</ContextMenuListItemView>
</Flex>
<Flex className="menu-list-split-3">
<ContextMenuListItemView onClick={ event => processAction('sign_16') }>
<i className="icon icon-sign-red" />
</ContextMenuListItemView>
<ContextMenuListItemView onClick={ event => processAction('sign_13') }>
<i className="icon icon-sign-exclamation" />
</ContextMenuListItemView>
<ContextMenuListItemView onClick={ event => processAction('sign_11') }>
<i className="icon icon-sign-heart" />
</ContextMenuListItemView>
</Flex>
<ContextMenuListItemView onClick={ event => processAction('back') }>
<FontAwesomeIcon icon="chevron-left" className="left" />

View File

@ -14,7 +14,7 @@ export const ChatWidgetMessageView: FC<ChatWidgetMessageViewProps> = props =>
const [ isVisible, setIsVisible ] = useState(false);
const elementRef = useRef<HTMLDivElement>();
const onMouseDown = (event: MouseEvent<HTMLDivElement>) => ((event.shiftKey) && onChatClicked(chat));
const onMouseDown = (event: MouseEvent<HTMLDivElement>) => onChatClicked(chat);
useEffect(() =>
{
@ -57,7 +57,7 @@ export const ChatWidgetMessageView: FC<ChatWidgetMessageViewProps> = props =>
useEffect(() => setIsVisible(chat.visible), [ chat.visible ]);
return (
<div ref={ elementRef } className="bubble-container" style={ { visibility: (isVisible ? 'visible' : 'hidden') } } onMouseDown={ onMouseDown }>
<div ref={ elementRef } className="bubble-container" style={ { visibility: (isVisible ? 'visible' : 'hidden') } } onClick={ onMouseDown }>
{ (chat.styleId === 0) && <div className="user-container-bg" style={ { backgroundColor: chat.color } } /> }
<div className={ 'chat-bubble bubble-' + chat.styleId + ' type-' + chat.type }>
<div className="user-container">

View File

@ -39,11 +39,6 @@
// -webkit-animation-name: bounceIn;
// animation-name: bounceIn;
&:hover,
&:active {
pointer-events: none;
}
.user-container-bg {
position: absolute;
top: -1px;