mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Mm 52259 system message ignore colorize (#23630)
* MM-52259 - fix system message using not themed color * fix unit tests and code clean up
This commit is contained in:
parent
c06c47f22e
commit
e60e2dc040
@ -147,7 +147,7 @@ exports[`components/UserProfile should match snapshot, with colorization 1`] = `
|
||||
className="user-popover style--none"
|
||||
style={
|
||||
Object {
|
||||
"color": "#000000",
|
||||
"color": "#bbd279",
|
||||
}
|
||||
}
|
||||
>
|
||||
|
@ -5,6 +5,7 @@ import React from 'react';
|
||||
import {shallow} from 'enzyme';
|
||||
|
||||
import {UserProfile as UserProfileType} from '@mattermost/types/users';
|
||||
import {Preferences} from 'mattermost-redux/constants';
|
||||
|
||||
import UserProfile from './user_profile';
|
||||
|
||||
@ -14,6 +15,7 @@ describe('components/UserProfile', () => {
|
||||
isBusy: false,
|
||||
user: {username: 'username'} as UserProfileType,
|
||||
userId: 'user_id',
|
||||
theme: Preferences.THEMES.onyx,
|
||||
};
|
||||
|
||||
test('should match snapshot', () => {
|
||||
|
@ -90,7 +90,7 @@ export default class UserProfile extends PureComponent<UserProfileProps> {
|
||||
|
||||
const ariaName: string = typeof name === 'string' ? name.toLowerCase() : '';
|
||||
|
||||
let userColor = '#000000';
|
||||
let userColor = theme?.centerChannelColor;
|
||||
if (user && theme) {
|
||||
userColor = generateColor(user.username, theme.centerChannelBg);
|
||||
}
|
||||
@ -130,7 +130,7 @@ export default class UserProfile extends PureComponent<UserProfileProps> {
|
||||
}
|
||||
|
||||
return (
|
||||
<React.Fragment>
|
||||
<>
|
||||
<OverlayTrigger
|
||||
ref={this.setOverlaynRef}
|
||||
trigger={['click']}
|
||||
@ -163,7 +163,7 @@ export default class UserProfile extends PureComponent<UserProfileProps> {
|
||||
{sharedIcon}
|
||||
{(user && user.is_bot) && <BotTag/>}
|
||||
{(user && isGuest(user.roles)) && <GuestTag/>}
|
||||
</React.Fragment>
|
||||
</>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user