fix(aot): Remove dependency to translate from StatelessAvatar.js

- translate uses interfaceConfig object which does not exist in AOT context
This commit is contained in:
hmuresan 2021-07-15 14:41:57 +03:00 committed by Horatiu Muresan
parent 8f81a75a61
commit b3e03fe50c
1 changed files with 4 additions and 12 deletions

View File

@ -2,7 +2,6 @@
import React from 'react'; import React from 'react';
import { translate } from '../../../../base/i18n';
import { Icon } from '../../../icons'; import { Icon } from '../../../icons';
import AbstractStatelessAvatar, { type Props as AbstractProps } from '../AbstractStatelessAvatar'; import AbstractStatelessAvatar, { type Props as AbstractProps } from '../AbstractStatelessAvatar';
@ -31,19 +30,14 @@ type Props = AbstractProps & {
/** /**
* TestId of the element, if any. * TestId of the element, if any.
*/ */
testId?: string, testId?: string
/**
* Invoked to obtain translated strings.
*/
t: Function
}; };
/** /**
* Implements a stateless avatar component that renders an avatar purely from what gets passed through * Implements a stateless avatar component that renders an avatar purely from what gets passed through
* props. * props.
*/ */
class StatelessAvatar extends AbstractStatelessAvatar<Props> { export default class StatelessAvatar extends AbstractStatelessAvatar<Props> {
/** /**
* Implements {@code Component#render}. * Implements {@code Component#render}.
* *
@ -70,7 +64,7 @@ class StatelessAvatar extends AbstractStatelessAvatar<Props> {
return ( return (
<div className = { this._getBadgeClassName() }> <div className = { this._getBadgeClassName() }>
<img <img
alt = { this.props.t('profile.avatar') } alt = 'avatar'
className = { this._getAvatarClassName() } className = { this._getAvatarClassName() }
data-testid = { this.props.testId } data-testid = { this.props.testId }
id = { this.props.id } id = { this.props.id }
@ -111,7 +105,7 @@ class StatelessAvatar extends AbstractStatelessAvatar<Props> {
return ( return (
<div className = { this._getBadgeClassName() }> <div className = { this._getBadgeClassName() }>
<img <img
alt = { this.props.t('profile.avatar') } alt = 'avatar'
className = { this._getAvatarClassName('defaultAvatar') } className = { this._getAvatarClassName('defaultAvatar') }
data-testid = { this.props.testId } data-testid = { this.props.testId }
id = { this.props.id } id = { this.props.id }
@ -165,5 +159,3 @@ class StatelessAvatar extends AbstractStatelessAvatar<Props> {
_isIcon: (?string | ?Object) => boolean _isIcon: (?string | ?Object) => boolean
} }
export default translate(StatelessAvatar);