Skip to content

Commit

Permalink
pm-conversations: Show "Muted User" placeholder in group PMs.
Browse files Browse the repository at this point in the history
  • Loading branch information
WesleyAC committed May 20, 2021
1 parent a5533a1 commit 31c4bc8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/pm-conversations/GroupPmConversationItem.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
/* @flow strict-local */
import React from 'react';
import React, { useContext } from 'react';
import { View } from 'react-native';
import { useSelector } from '../react-redux';

import type { UserOrBot } from '../types';
import styles, { createStyleSheet } from '../styles';
import { GroupAvatar, RawLabel, Touchable, UnreadCount } from '../common';
import { getMutedUsers } from '../selectors';
import { TranslationContext } from '../boot/TranslationProvider';

const componentStyles = createStyleSheet({
text: {
Expand All @@ -30,7 +33,11 @@ export default function GroupPmConversationItem<U: $ReadOnlyArray<UserOrBot>>(pr
};

const { users, unreadCount } = props;
const names = users.map(user => user.full_name);
const _ = useContext(TranslationContext);
const mutedUsers = useSelector(getMutedUsers);
const names = users.map(user =>
mutedUsers.has(user.user_id) ? _('Muted user') : user.full_name,
);

return (
<Touchable onPress={handlePress}>
Expand Down
1 change: 1 addition & 0 deletions static/translations/messages_en.json
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
"Reactions": "Reactions",
"No reactions": "No reactions",
"See who reacted": "See who reacted",
"Muted user": "Muted user",
"Only organization admins are allowed to post to this stream.": "Only organization admins are allowed to post to this stream.",
"Set a status": "Set a status",
"Connecting...": "Connecting...",
Expand Down

0 comments on commit 31c4bc8

Please sign in to comment.