This repository was archived by the owner on Sep 11, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +30
-10
lines changed
src/components/views/avatars Expand file tree Collapse file tree 1 file changed +30
-10
lines changed Original file line number Diff line number Diff line change @@ -145,17 +145,37 @@ module.exports = React.createClass({
145
145
146
146
if ( imageUrl === this . state . defaultImageUrl ) {
147
147
const initialLetter = this . _getInitialLetter ( name ) ;
148
- return (
149
- < span className = "mx_BaseAvatar" { ...otherProps } >
150
- < EmojiText className = "mx_BaseAvatar_initial" aria-hidden = "true"
151
- style = { { fontSize : ( width * 0.65 ) + "px" ,
152
- width : width + "px" ,
153
- lineHeight : height + "px" } } > { initialLetter } </ EmojiText >
154
- < img className = "mx_BaseAvatar_image" src = { imageUrl }
155
- alt = "" title = { title } onError = { this . onError }
156
- width = { width } height = { height } />
157
- </ span >
148
+ const textNode = (
149
+ < EmojiText className = "mx_BaseAvatar_initial" aria-hidden = "true"
150
+ style = { { fontSize : ( width * 0.65 ) + "px" ,
151
+ width : width + "px" ,
152
+ lineHeight : height + "px" } }
153
+ >
154
+ { initialLetter }
155
+ </ EmojiText >
156
+ ) ;
157
+ const imgNode = (
158
+ < img className = "mx_BaseAvatar_image" src = { imageUrl }
159
+ alt = "" title = { title } onError = { this . onError }
160
+ width = { width } height = { height } />
158
161
) ;
162
+ if ( onClick != null ) {
163
+ return (
164
+ < AccessibleButton element = 'span' className = "mx_BaseAvatar"
165
+ onClick = { onClick } { ...otherProps }
166
+ >
167
+ { textNode }
168
+ { imgNode }
169
+ </ AccessibleButton >
170
+ ) ;
171
+ } else {
172
+ return (
173
+ < span className = "mx_BaseAvatar" { ...otherProps } >
174
+ { textNode }
175
+ { imgNode }
176
+ </ span >
177
+ ) ;
178
+ }
159
179
}
160
180
if ( onClick != null ) {
161
181
return (
You can’t perform that action at this time.
0 commit comments