import React from 'react'; import classNames from 'classnames'; import { ContextMenu, ContextMenuTrigger, MenuItem, SubMenu, } from 'react-contextmenu'; import { Emojify } from './Emojify'; import { Avatar } from '../Avatar'; import { InContactsIcon } from '../InContactsIcon'; import { LocalizerType } from '../../types/Util'; import { ColorType } from '../../types/Colors'; interface TimerOption { name: string; value: number; } export interface PropsDataType { id: string; name?: string; phoneNumber?: string; profileName?: string; color?: ColorType; avatarPath?: string; type: 'direct' | 'group'; title: string; isAccepted?: boolean; isVerified?: boolean; isMe?: boolean; isArchived?: boolean; leftGroup?: boolean; expirationSettingName?: string; showBackButton?: boolean; timerOptions?: Array; } export interface PropsActionsType { onSetDisappearingMessages: (seconds: number) => void; onDeleteMessages: () => void; onResetSession: () => void; onSearchInConversation: () => void; onOutgoingAudioCallInConversation: () => void; onOutgoingVideoCallInConversation: () => void; onShowSafetyNumber: () => void; onShowAllMedia: () => void; onShowGroupMembers: () => void; onGoBack: () => void; onArchive: () => void; onMoveToInbox: () => void; } export interface PropsHousekeepingType { i18n: LocalizerType; } export type PropsType = PropsDataType & PropsActionsType & PropsHousekeepingType; export class ConversationHeader extends React.Component { public showMenuBound: (event: React.MouseEvent) => void; public menuTriggerRef: React.RefObject; public constructor(props: PropsType) { super(props); this.menuTriggerRef = React.createRef(); this.showMenuBound = this.showMenu.bind(this); } public showMenu(event: React.MouseEvent) { if (this.menuTriggerRef.current) { this.menuTriggerRef.current.handleContextClick(event); } } public renderBackButton() { const { onGoBack, showBackButton } = this.props; return (