Add "call back", "call again" buttons to timeline
This commit is contained in:
parent
d94f1151b1
commit
bfa0bbf7da
9 changed files with 203 additions and 71 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue