[MM-55122] Replaced the usage of LocalizedIcon in 'fa_warning_icon.tsx' with i/span tags (#25136)
Этот коммит содержится в:
@@ -115,15 +115,45 @@ exports[`components/admin_console/request_button/request_button.jsx should match
|
|||||||
<div
|
<div
|
||||||
className="alert alert-warning"
|
className="alert alert-warning"
|
||||||
>
|
>
|
||||||
|
<injectIntl(WarningIcon)>
|
||||||
<WarningIcon
|
<WarningIcon
|
||||||
additionalClassName={null}
|
intl={
|
||||||
>
|
|
||||||
<LocalizedIcon
|
|
||||||
className="fa fa-warning"
|
|
||||||
title={
|
|
||||||
Object {
|
Object {
|
||||||
"defaultMessage": "Warning Icon",
|
"$t": [Function],
|
||||||
"id": "generic_icons.warning",
|
"defaultFormats": Object {},
|
||||||
|
"defaultLocale": "en",
|
||||||
|
"defaultRichTextElements": undefined,
|
||||||
|
"fallbackOnEmptyString": true,
|
||||||
|
"formatDate": [Function],
|
||||||
|
"formatDateTimeRange": [Function],
|
||||||
|
"formatDateToParts": [Function],
|
||||||
|
"formatDisplayName": [Function],
|
||||||
|
"formatList": [Function],
|
||||||
|
"formatListToParts": [Function],
|
||||||
|
"formatMessage": [Function],
|
||||||
|
"formatNumber": [Function],
|
||||||
|
"formatNumberToParts": [Function],
|
||||||
|
"formatPlural": [Function],
|
||||||
|
"formatRelativeTime": [Function],
|
||||||
|
"formatTime": [Function],
|
||||||
|
"formatTimeToParts": [Function],
|
||||||
|
"formats": Object {},
|
||||||
|
"formatters": Object {
|
||||||
|
"getDateTimeFormat": [Function],
|
||||||
|
"getDisplayNames": [Function],
|
||||||
|
"getListFormat": [Function],
|
||||||
|
"getMessageFormat": [Function],
|
||||||
|
"getNumberFormat": [Function],
|
||||||
|
"getPluralRules": [Function],
|
||||||
|
"getRelativeTimeFormat": [Function],
|
||||||
|
},
|
||||||
|
"locale": "en",
|
||||||
|
"messages": Object {},
|
||||||
|
"onError": [Function],
|
||||||
|
"onWarn": [Function],
|
||||||
|
"textComponent": "span",
|
||||||
|
"timeZone": "Etc/UTC",
|
||||||
|
"wrapRichTextChunksInFragment": undefined,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -131,8 +161,8 @@ exports[`components/admin_console/request_button/request_button.jsx should match
|
|||||||
className="fa fa-warning"
|
className="fa fa-warning"
|
||||||
title="Warning Icon"
|
title="Warning Icon"
|
||||||
/>
|
/>
|
||||||
</LocalizedIcon>
|
|
||||||
</WarningIcon>
|
</WarningIcon>
|
||||||
|
</injectIntl(WarningIcon)>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Error Message: {error}"
|
defaultMessage="Error Message: {error}"
|
||||||
id="error.message"
|
id="error.message"
|
||||||
@@ -252,15 +282,45 @@ exports[`components/admin_console/request_button/request_button.jsx should match
|
|||||||
<div
|
<div
|
||||||
className="alert alert-warning"
|
className="alert alert-warning"
|
||||||
>
|
>
|
||||||
|
<injectIntl(WarningIcon)>
|
||||||
<WarningIcon
|
<WarningIcon
|
||||||
additionalClassName={null}
|
intl={
|
||||||
>
|
|
||||||
<LocalizedIcon
|
|
||||||
className="fa fa-warning"
|
|
||||||
title={
|
|
||||||
Object {
|
Object {
|
||||||
"defaultMessage": "Warning Icon",
|
"$t": [Function],
|
||||||
"id": "generic_icons.warning",
|
"defaultFormats": Object {},
|
||||||
|
"defaultLocale": "en",
|
||||||
|
"defaultRichTextElements": undefined,
|
||||||
|
"fallbackOnEmptyString": true,
|
||||||
|
"formatDate": [Function],
|
||||||
|
"formatDateTimeRange": [Function],
|
||||||
|
"formatDateToParts": [Function],
|
||||||
|
"formatDisplayName": [Function],
|
||||||
|
"formatList": [Function],
|
||||||
|
"formatListToParts": [Function],
|
||||||
|
"formatMessage": [Function],
|
||||||
|
"formatNumber": [Function],
|
||||||
|
"formatNumberToParts": [Function],
|
||||||
|
"formatPlural": [Function],
|
||||||
|
"formatRelativeTime": [Function],
|
||||||
|
"formatTime": [Function],
|
||||||
|
"formatTimeToParts": [Function],
|
||||||
|
"formats": Object {},
|
||||||
|
"formatters": Object {
|
||||||
|
"getDateTimeFormat": [Function],
|
||||||
|
"getDisplayNames": [Function],
|
||||||
|
"getListFormat": [Function],
|
||||||
|
"getMessageFormat": [Function],
|
||||||
|
"getNumberFormat": [Function],
|
||||||
|
"getPluralRules": [Function],
|
||||||
|
"getRelativeTimeFormat": [Function],
|
||||||
|
},
|
||||||
|
"locale": "en",
|
||||||
|
"messages": Object {},
|
||||||
|
"onError": [Function],
|
||||||
|
"onWarn": [Function],
|
||||||
|
"textComponent": "span",
|
||||||
|
"timeZone": "Etc/UTC",
|
||||||
|
"wrapRichTextChunksInFragment": undefined,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
@@ -268,8 +328,8 @@ exports[`components/admin_console/request_button/request_button.jsx should match
|
|||||||
className="fa fa-warning"
|
className="fa fa-warning"
|
||||||
title="Warning Icon"
|
title="Warning Icon"
|
||||||
/>
|
/>
|
||||||
</LocalizedIcon>
|
|
||||||
</WarningIcon>
|
</WarningIcon>
|
||||||
|
</injectIntl(WarningIcon)>
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
defaultMessage="Error Message: {error}"
|
defaultMessage="Error Message: {error}"
|
||||||
id="error.message"
|
id="error.message"
|
||||||
|
|||||||
@@ -1,28 +1,24 @@
|
|||||||
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
// Copyright (c) 2015-present Mattermost, Inc. All Rights Reserved.
|
||||||
// See LICENSE.txt for license information.
|
// See LICENSE.txt for license information.
|
||||||
|
|
||||||
|
import classNames from 'classnames';
|
||||||
import React from 'react';
|
import React from 'react';
|
||||||
|
import {injectIntl, type IntlShape} from 'react-intl';
|
||||||
import LocalizedIcon from 'components/localized_icon';
|
|
||||||
|
|
||||||
import {t} from 'utils/i18n';
|
|
||||||
|
|
||||||
type Props = {
|
type Props = {
|
||||||
additionalClassName: string | null;
|
additionalClassName?: string;
|
||||||
|
intl: IntlShape;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default class WarningIcon extends React.PureComponent<Props> {
|
class WarningIcon extends React.PureComponent<Props> {
|
||||||
public static defaultProps: Props = {
|
|
||||||
additionalClassName: null,
|
|
||||||
};
|
|
||||||
|
|
||||||
public render(): JSX.Element {
|
public render(): JSX.Element {
|
||||||
const className = 'fa fa-warning' + (this.props.additionalClassName ? ' ' + this.props.additionalClassName : '');
|
|
||||||
return (
|
return (
|
||||||
<LocalizedIcon
|
<i
|
||||||
className={className}
|
className={classNames('fa fa-warning', this.props.additionalClassName)}
|
||||||
title={{id: t('generic_icons.warning'), defaultMessage: 'Warning Icon'}}
|
title={this.props.intl.formatMessage({id: 'generic_icons.warning', defaultMessage: 'Warning Icon'})}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export default injectIntl(WarningIcon);
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user