Add "call back", "call again" buttons to timeline

This commit is contained in:
Evan Hahn 2021-09-10 18:59:41 -05:00 committed by GitHub
parent d94f1151b1
commit bfa0bbf7da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 203 additions and 71 deletions

View file

@ -19,9 +19,11 @@ import { SmartContactName } from './ContactName';
import { SmartUniversalTimerNotification } from './UniversalTimerNotification';
type ExternalProps = {
id: string;
conversationId: string;
containerElementRef: RefObject<HTMLElement>;
conversationId: string;
messageId: string;
nextMessageId: undefined | string;
previousMessageId: undefined | string;
};
// Workaround: A react component's required properties are filtering up through connect()
@ -39,19 +41,34 @@ function renderUniversalTimerNotification(): JSX.Element {
}
const mapStateToProps = (state: StateType, props: ExternalProps) => {
const { id, conversationId, containerElementRef } = props;
const {
containerElementRef,
conversationId,
messageId,
nextMessageId,
previousMessageId,
} = props;
const messageSelector = getMessageSelector(state);
const item = messageSelector(id);
const item = messageSelector(messageId);
const previousItem = previousMessageId
? messageSelector(previousMessageId)
: undefined;
const nextItem = nextMessageId ? messageSelector(nextMessageId) : undefined;
const selectedMessage = getSelectedMessage(state);
const isSelected = Boolean(selectedMessage && id === selectedMessage.id);
const isSelected = Boolean(
selectedMessage && messageId === selectedMessage.id
);
const conversation = getConversationSelector(state)(conversationId);
return {
item,
id,
previousItem,
nextItem,
id: messageId,
containerElementRef,
conversationId,
conversationColor: conversation?.conversationColor,