@@ -145,30 +145,30 @@ module.exports = React.createClass({
145
145
146
146
if ( imageUrl === this . state . defaultImageUrl ) {
147
147
const initialLetter = this . _getInitialLetter ( name ) ;
148
+ const textNode = < EmojiText className = "mx_BaseAvatar_initial" aria-hidden = "true"
149
+ style = { { fontSize : ( width * 0.65 ) + "px" ,
150
+ width : width + "px" ,
151
+ lineHeight : height + "px" } }
152
+ >
153
+ { initialLetter }
154
+ </ EmojiText > ;
155
+ const imgNode = < img className = "mx_BaseAvatar_image" src = { imageUrl }
156
+ alt = "" title = { title } onError = { this . onError }
157
+ width = { width } height = { height } /> ;
148
158
if ( onClick != null ) {
149
159
return (
150
160
< AccessibleButton element = 'span' className = "mx_BaseAvatar"
151
161
onClick = { onClick } { ...otherProps }
152
162
>
153
- < EmojiText className = "mx_BaseAvatar_initial" aria-hidden = "true"
154
- style = { { fontSize : ( width * 0.65 ) + "px" ,
155
- width : width + "px" ,
156
- lineHeight : height + "px" } } > { initialLetter } </ EmojiText >
157
- < img className = "mx_BaseAvatar_image" src = { imageUrl }
158
- alt = "" title = { title } onError = { this . onError }
159
- width = { width } height = { height } />
163
+ { textNode }
164
+ { imgNode }
160
165
</ AccessibleButton >
161
166
) ;
162
167
} else {
163
168
return (
164
169
< span className = "mx_BaseAvatar" { ...otherProps } >
165
- < EmojiText className = "mx_BaseAvatar_initial" aria-hidden = "true"
166
- style = { { fontSize : ( width * 0.65 ) + "px" ,
167
- width : width + "px" ,
168
- lineHeight : height + "px" } } > { initialLetter } </ EmojiText >
169
- < img className = "mx_BaseAvatar_image" src = { imageUrl }
170
- alt = "" title = { title } onError = { this . onError }
171
- width = { width } height = { height } />
170
+ { textNode }
171
+ { imgNode }
172
172
</ span >
173
173
) ;
174
174
}
0 commit comments