render GroupNotification messages

pull/1387/head
Audric Ackermann 5 years ago
parent 96263b4d25
commit 07c384aa0d
No known key found for this signature in database
GPG Key ID: 999F434D76324AD4

@ -937,6 +937,10 @@
.module-contact-name__profile-name { .module-contact-name__profile-name {
text-align: center; text-align: center;
} }
.module-message__author__profile-name {
margin-inline-end: $session-margin-xs;
}
} }
.module-notification--with-click-handler { .module-notification--with-click-handler {

@ -766,8 +766,6 @@ label {
} }
} }
.react-contexify__item:not(.react-contexify__item--disabled):hover .react-contexify__item:not(.react-contexify__item--disabled):hover
> .react-contexify__item__content { > .react-contexify__item__content {
@include themify($themes) { @include themify($themes) {

@ -21,7 +21,6 @@ interface Change {
interface Props { interface Props {
changes: Array<Change>; changes: Array<Change>;
i18n: LocalizerType;
} }
// This class is used to display group updates in the conversation view. // This class is used to display group updates in the conversation view.
@ -29,7 +28,7 @@ interface Props {
export class GroupNotification extends React.Component<Props> { export class GroupNotification extends React.Component<Props> {
public renderChange(change: Change) { public renderChange(change: Change) {
const { isMe, contacts, type, newName } = change; const { isMe, contacts, type, newName } = change;
const { i18n } = this.props; const { i18n } = window;
const people = compact( const people = compact(
flatten( flatten(

@ -10,6 +10,7 @@ import _ from 'lodash';
import { ConversationModel } from '../../../../js/models/conversations'; import { ConversationModel } from '../../../../js/models/conversations';
import { contextMenu } from 'react-contexify'; import { contextMenu } from 'react-contexify';
import { AttachmentType } from '../../../types/Attachment'; import { AttachmentType } from '../../../types/Attachment';
import { GroupNotification } from '../../conversation/GroupNotification';
interface State { interface State {
isScrolledToBottom: boolean; isScrolledToBottom: boolean;
@ -119,25 +120,25 @@ export class SessionConversationMessagesList extends React.Component<
const attachmentProps = message.propsForAttachment; const attachmentProps = message.propsForAttachment;
const groupNotificationProps = message.propsForGroupNotification; const groupNotificationProps = message.propsForGroupNotification;
let item; if (groupNotificationProps) {
return <GroupNotification {...groupNotificationProps} />;
}
if (resetSessionProps) {
return <ResetSessionNotification {...resetSessionProps} />;
}
if (timerProps) {
return <TimerNotification {...timerProps} />;
}
// firstMessageOfSeries tells us to render the avatar only for the first message // firstMessageOfSeries tells us to render the avatar only for the first message
// in a series of messages from the same user // in a series of messages from the same user
item = messageProps return this.renderMessage(
? this.renderMessage( messageProps,
messageProps, message.firstMessageOfSeries,
message.firstMessageOfSeries, multiSelectMode
multiSelectMode
)
: item;
item = timerProps ? <TimerNotification {...timerProps} /> : item;
item = resetSessionProps ? (
<ResetSessionNotification {...resetSessionProps} />
) : (
item
); );
return item;
})} })}
</> </>
); );

@ -177,7 +177,10 @@ function removeAllConversations(): RemoveAllConversationsActionType {
}; };
} }
function loadMoreMessages(id: string, currentMessageCount: number): LoadMoreMessagesActionType { function loadMoreMessages(
id: string,
currentMessageCount: number
): LoadMoreMessagesActionType {
return { return {
type: 'LOAD_MORE_MESSAGES_ACTION_TYPE', type: 'LOAD_MORE_MESSAGES_ACTION_TYPE',
payload: { payload: {
@ -227,7 +230,6 @@ function openConversationExternal(
}; };
} }
// Reducer // Reducer
function getEmptyState(): ConversationsStateType { function getEmptyState(): ConversationsStateType {

Loading…
Cancel
Save