Update group name colors
This commit is contained in:
parent
a374772dc8
commit
df7f702dde
5 changed files with 25 additions and 13 deletions
|
@ -912,8 +912,6 @@
|
|||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
|
||||
color: $color-white-alpha-90;
|
||||
|
||||
&__profile-name {
|
||||
@include font-caption-bold-italic;
|
||||
}
|
||||
|
|
|
@ -17,6 +17,7 @@ import {
|
|||
import { LocalizerType } from '../../types/Util';
|
||||
import { ConversationType } from '../../state/ducks/conversations';
|
||||
import { assert } from '../../util/assert';
|
||||
import { ContactNameColorType } from '../../types/Colors';
|
||||
|
||||
export type Contact = Pick<
|
||||
ConversationType,
|
||||
|
@ -45,6 +46,7 @@ export type Contact = Pick<
|
|||
|
||||
export type Props = {
|
||||
contacts: Array<Contact>;
|
||||
contactNameColor?: ContactNameColorType;
|
||||
errors: Array<Error>;
|
||||
message: MessagePropsDataType;
|
||||
receivedAt: number;
|
||||
|
@ -232,6 +234,7 @@ export class MessageDetail extends React.Component<Props> {
|
|||
sentAt,
|
||||
|
||||
clearSelectedMessage,
|
||||
contactNameColor,
|
||||
deleteMessage,
|
||||
deleteMessageForEveryone,
|
||||
displayTapToViewMessage,
|
||||
|
@ -263,6 +266,7 @@ export class MessageDetail extends React.Component<Props> {
|
|||
<Message
|
||||
{...message}
|
||||
clearSelectedMessage={clearSelectedMessage}
|
||||
contactNameColor={contactNameColor}
|
||||
deleteMessage={deleteMessage}
|
||||
deleteMessageForEveryone={deleteMessageForEveryone}
|
||||
disableMenu
|
||||
|
|
|
@ -15,6 +15,7 @@ import { StateType } from '../reducer';
|
|||
import { getIntl, getInteractionMode } from '../selectors/user';
|
||||
import { renderAudioAttachment } from './renderAudioAttachment';
|
||||
import { renderEmojiPicker } from './renderEmojiPicker';
|
||||
import { getContactNameColorSelector } from '../selectors/conversations';
|
||||
|
||||
type MessageDetailProps = ComponentProps<typeof MessageDetail>;
|
||||
|
||||
|
@ -79,8 +80,17 @@ const mapStateToProps = (
|
|||
showVisualAttachment,
|
||||
} = props;
|
||||
|
||||
const contactNameColor =
|
||||
message.conversationType === 'group'
|
||||
? getContactNameColorSelector(state)(
|
||||
message.conversationId,
|
||||
message.author.id
|
||||
)
|
||||
: undefined;
|
||||
|
||||
return {
|
||||
contacts,
|
||||
contactNameColor,
|
||||
errors,
|
||||
message,
|
||||
receivedAt,
|
||||
|
|
|
@ -1862,12 +1862,12 @@ describe('both/state/selectors/conversations', () => {
|
|||
const contactNameColorSelector = getContactNameColorSelector(state);
|
||||
|
||||
assert.equal(contactNameColorSelector('group', 'gfe'), '200');
|
||||
assert.equal(contactNameColorSelector('group', 'jih'), '150');
|
||||
assert.equal(contactNameColorSelector('group', 'mlk'), '010');
|
||||
assert.equal(contactNameColorSelector('group', 'pon'), '300');
|
||||
assert.equal(contactNameColorSelector('group', 'srq'), '210');
|
||||
assert.equal(contactNameColorSelector('group', 'vut'), '090');
|
||||
assert.equal(contactNameColorSelector('group', 'zyx'), '330');
|
||||
assert.equal(contactNameColorSelector('group', 'jih'), '120');
|
||||
assert.equal(contactNameColorSelector('group', 'mlk'), '300');
|
||||
assert.equal(contactNameColorSelector('group', 'pon'), '010');
|
||||
assert.equal(contactNameColorSelector('group', 'srq'), '330');
|
||||
assert.equal(contactNameColorSelector('group', 'vut'), '230');
|
||||
assert.equal(contactNameColorSelector('group', 'zyx'), '180');
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
@ -44,19 +44,19 @@ export const ConversationColors = [
|
|||
|
||||
export const ContactNameColors = [
|
||||
'200',
|
||||
'150',
|
||||
'010',
|
||||
'120',
|
||||
'300',
|
||||
'010',
|
||||
'210',
|
||||
'090',
|
||||
'330',
|
||||
'230',
|
||||
'030',
|
||||
'180',
|
||||
'030',
|
||||
'340',
|
||||
'270',
|
||||
'090',
|
||||
'000',
|
||||
'120',
|
||||
'150',
|
||||
'240',
|
||||
'040',
|
||||
'160',
|
||||
|
|
Loading…
Reference in a new issue