|
|
|
@ -1,5 +1,5 @@
|
|
|
|
|
import React, { useEffect, useState } from 'react';
|
|
|
|
|
import { SessionIconButton, SessionIconType } from './icon';
|
|
|
|
|
import { SessionIconButton } from './icon';
|
|
|
|
|
import { Avatar, AvatarSize } from '../Avatar';
|
|
|
|
|
import { SessionToastContainer } from './SessionToastContainer';
|
|
|
|
|
import { getConversationController } from '../../session/conversations';
|
|
|
|
@ -96,47 +96,71 @@ const Section = (props: { type: SectionType; avatarPath?: string | null }) => {
|
|
|
|
|
onAvatarClick={handleClick}
|
|
|
|
|
name={userName}
|
|
|
|
|
pubkey={ourNumber}
|
|
|
|
|
dataTestId="leftpane-primary-avatar"
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const unreadToShow = type === SectionType.Message ? unreadMessageCount : undefined;
|
|
|
|
|
|
|
|
|
|
let iconType: SessionIconType;
|
|
|
|
|
switch (type) {
|
|
|
|
|
case SectionType.Message:
|
|
|
|
|
iconType = 'chatBubble';
|
|
|
|
|
break;
|
|
|
|
|
return (
|
|
|
|
|
<SessionIconButton
|
|
|
|
|
iconSize="medium"
|
|
|
|
|
dataTestId="message-section"
|
|
|
|
|
iconType={'chatBubble'}
|
|
|
|
|
iconColor={undefined}
|
|
|
|
|
notificationCount={unreadToShow}
|
|
|
|
|
onClick={handleClick}
|
|
|
|
|
isSelected={isSelected}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
case SectionType.Contact:
|
|
|
|
|
iconType = 'users';
|
|
|
|
|
break;
|
|
|
|
|
return (
|
|
|
|
|
<SessionIconButton
|
|
|
|
|
iconSize="medium"
|
|
|
|
|
dataTestId="contact-section"
|
|
|
|
|
iconType={'users'}
|
|
|
|
|
iconColor={undefined}
|
|
|
|
|
notificationCount={unreadToShow}
|
|
|
|
|
onClick={handleClick}
|
|
|
|
|
isSelected={isSelected}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
case SectionType.Settings:
|
|
|
|
|
iconType = 'gear';
|
|
|
|
|
break;
|
|
|
|
|
case SectionType.Moon:
|
|
|
|
|
iconType = 'moon';
|
|
|
|
|
break;
|
|
|
|
|
return (
|
|
|
|
|
<SessionIconButton
|
|
|
|
|
iconSize="medium"
|
|
|
|
|
dataTestId="settings-section"
|
|
|
|
|
iconType={'gear'}
|
|
|
|
|
iconColor={undefined}
|
|
|
|
|
notificationCount={unreadToShow}
|
|
|
|
|
onClick={handleClick}
|
|
|
|
|
isSelected={isSelected}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
case SectionType.PathIndicator:
|
|
|
|
|
return (
|
|
|
|
|
<ActionPanelOnionStatusLight
|
|
|
|
|
dataTestId="onion-status-section"
|
|
|
|
|
handleClick={handleClick}
|
|
|
|
|
isSelected={isSelected}
|
|
|
|
|
/>
|
|
|
|
|
);
|
|
|
|
|
default:
|
|
|
|
|
iconType = 'moon';
|
|
|
|
|
}
|
|
|
|
|
const iconColor = undefined;
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<>
|
|
|
|
|
{type === SectionType.PathIndicator ? (
|
|
|
|
|
<ActionPanelOnionStatusLight handleClick={handleClick} isSelected={isSelected} />
|
|
|
|
|
) : (
|
|
|
|
|
return (
|
|
|
|
|
<SessionIconButton
|
|
|
|
|
iconSize={'medium'}
|
|
|
|
|
iconType={iconType}
|
|
|
|
|
iconColor={iconColor}
|
|
|
|
|
iconSize="medium"
|
|
|
|
|
iconType={'moon'}
|
|
|
|
|
dataTestId="theme-section"
|
|
|
|
|
iconColor={undefined}
|
|
|
|
|
notificationCount={unreadToShow}
|
|
|
|
|
onClick={handleClick}
|
|
|
|
|
isSelected={isSelected}
|
|
|
|
|
/>
|
|
|
|
|
)}
|
|
|
|
|
</>
|
|
|
|
|
);
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const cleanUpMediasInterval = DURATION.MINUTES * 30;
|
|
|
|
@ -300,7 +324,10 @@ export const ActionsPanel = () => {
|
|
|
|
|
<ModalContainer />
|
|
|
|
|
|
|
|
|
|
<CallContainer />
|
|
|
|
|
<div className="module-left-pane__sections-container">
|
|
|
|
|
<div
|
|
|
|
|
className="module-left-pane__sections-container"
|
|
|
|
|
data-testid="leftpane-section-container"
|
|
|
|
|
>
|
|
|
|
|
<Section type={SectionType.Profile} avatarPath={ourPrimaryConversation.avatarPath} />
|
|
|
|
|
<Section type={SectionType.Message} />
|
|
|
|
|
<Section type={SectionType.Contact} />
|
|
|
|
|