fix: removed messagedetail check from convoheader

we no longer need the back button
pull/3017/head
William Grant 1 year ago
parent 3c5f0bf018
commit 7d7133a38c

@ -1,23 +1,18 @@
import React from 'react'; import React from 'react';
import { useDispatch, useSelector } from 'react-redux'; import { useDispatch, useSelector } from 'react-redux';
import { import { isMessageSelectionMode } from '../../../state/selectors/conversations';
isMessageDetailView,
isMessageSelectionMode,
} from '../../../state/selectors/conversations';
import { closeMessageDetailsView, openRightPanel } from '../../../state/ducks/conversations'; import { openRightPanel } from '../../../state/ducks/conversations';
import { useSelectedConversationKey } from '../../../state/selectors/selectedConversation'; import { useSelectedConversationKey } from '../../../state/selectors/selectedConversation';
import { Flex } from '../../basic/Flex'; import { Flex } from '../../basic/Flex';
import { AvatarHeader, BackButton, CallButton } from './ConversationHeaderItems'; import { AvatarHeader, CallButton } from './ConversationHeaderItems';
import { SelectionOverlay } from './ConversationHeaderSelectionOverlay'; import { SelectionOverlay } from './ConversationHeaderSelectionOverlay';
import { ConversationHeaderTitle } from './ConversationHeaderTitle'; import { ConversationHeaderTitle } from './ConversationHeaderTitle';
export const ConversationHeaderWithDetails = () => { export const ConversationHeaderWithDetails = () => {
const isSelectionMode = useSelector(isMessageSelectionMode); const isSelectionMode = useSelector(isMessageSelectionMode);
// TODO remove I think?
const isMessageDetailOpened = useSelector(isMessageDetailView);
const selectedConvoKey = useSelectedConversationKey(); const selectedConvoKey = useSelectedConversationKey();
const dispatch = useDispatch(); const dispatch = useDispatch();
@ -29,18 +24,11 @@ export const ConversationHeaderWithDetails = () => {
<div className="module-conversation-header"> <div className="module-conversation-header">
<Flex <Flex
container={true} container={true}
justifyContent={isMessageDetailOpened ? 'space-between' : 'flex-end'} justifyContent={'flex-end'}
alignItems="center" alignItems="center"
width="100%" width="100%"
flexGrow={1} flexGrow={1}
> >
{/* TODO do we remove */}
<BackButton
onGoBack={() => {
dispatch(closeMessageDetailsView());
}}
showBackButton={isMessageDetailOpened}
/>
<ConversationHeaderTitle /> <ConversationHeaderTitle />
{!isSelectionMode && ( {!isSelectionMode && (
@ -57,7 +45,6 @@ export const ConversationHeaderWithDetails = () => {
dispatch(openRightPanel()); dispatch(openRightPanel());
}} }}
pubkey={selectedConvoKey} pubkey={selectedConvoKey}
showBackButton={isMessageDetailOpened}
/> />
</Flex> </Flex>
)} )}

@ -16,18 +16,16 @@ import { SessionIconButton } from '../../icon';
export const AvatarHeader = (props: { export const AvatarHeader = (props: {
pubkey: string; pubkey: string;
showBackButton: boolean;
onAvatarClick?: (pubkey: string) => void; onAvatarClick?: (pubkey: string) => void;
}) => { }) => {
const { pubkey, onAvatarClick, showBackButton } = props; const { pubkey, onAvatarClick } = props;
return ( return (
<span className="module-conversation-header__avatar"> <span className="module-conversation-header__avatar">
<Avatar <Avatar
size={AvatarSize.S} size={AvatarSize.S}
onAvatarClick={() => { onAvatarClick={() => {
// do not allow right panel to appear if another button is shown on the SessionConversation if (onAvatarClick) {
if (onAvatarClick && !showBackButton) {
onAvatarClick(pubkey); onAvatarClick(pubkey);
} }
}} }}

@ -15,8 +15,7 @@ import {
replaceUnicodeV2, replaceUnicodeV2,
} from './attachments/migrations'; } from './attachments/migrations';
// I think this is only used on the renderer side, but how?! // NOTE I think this is only used on the renderer side, but how?!
export const deleteExternalMessageFiles = async (message: { export const deleteExternalMessageFiles = async (message: {
attachments: any; attachments: any;
quote: any; quote: any;

Loading…
Cancel
Save