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:
Pablo Andrés Vélez Vidal 2023-06-14 18:02:54 +02:00 committed by GitHub
parent c06c47f22e
commit e60e2dc040
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -147,7 +147,7 @@ exports[`components/UserProfile should match snapshot, with colorization 1`] = `
className="user-popover style--none"
style={
Object {
"color": "#000000",
"color": "#bbd279",
}
}
>

View File

@ -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', () => {

View File

@ -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>
</>
);
}
}