fix: resolved incoming message alignemnt in 1o1 conversations

there is never an avatar so we should never render it
pull/2757/head
William Grant 2 years ago
parent f87995a375
commit 712259ddef

@ -35,10 +35,10 @@ export type MessageAvatarSelectorProps = Pick<
| 'lastMessageOfSeries'
>;
type Props = { messageId: string; hideAvatar: boolean };
type Props = { messageId: string; hideAvatar: boolean; isPrivate: boolean };
export const MessageAvatar = (props: Props) => {
const { messageId, hideAvatar } = props;
const { messageId, hideAvatar, isPrivate } = props;
const dispatch = useDispatch();
const avatarProps = useSelector(state => getMessageAvatarProps(state as any, messageId));
@ -126,7 +126,10 @@ export const MessageAvatar = (props: Props) => {
return (
<StyledAvatar
key={`msg-avatar-${sender}`}
style={{ visibility: hideAvatar ? 'hidden' : undefined }}
style={{
visibility: hideAvatar ? 'hidden' : undefined,
display: isPrivate && hideAvatar ? 'none' : undefined,
}}
>
<Avatar size={AvatarSize.S} onAvatarClick={onMessageAvatarClick} pubkey={sender} />
{isSenderAdmin && <CrownIcon />}

@ -94,7 +94,9 @@ export const MessageContentWithStatuses = (props: Props) => {
}
const { conversationType, direction, isDeleted } = contentProps;
const isIncoming = direction === 'incoming';
const hideAvatar = conversationType !== 'group' || direction === 'outgoing';
const isPrivate = conversationType === 'private';
const hideAvatar = isPrivate || direction === 'outgoing';
const [popupReaction, setPopupReaction] = useState('');
@ -120,7 +122,7 @@ export const MessageContentWithStatuses = (props: Props) => {
onDoubleClickCapture={onDoubleClickReplyToMessage}
data-testid={dataTestId}
>
<MessageAvatar messageId={messageId} hideAvatar={hideAvatar} />
<MessageAvatar messageId={messageId} hideAvatar={hideAvatar} isPrivate={isPrivate} />
<MessageStatus
dataTestId="msg-status-incoming"
messageId={messageId}

Loading…
Cancel
Save