Skip to content

Commit 64ee17f

Browse files
markstoryNisanthan Nanthakumar
authored and
Nisanthan Nanthakumar
committed
fix(ui) Fix gravatar fallbacks (#16336)
When updating Gravatar to typescript, I removed some property spreads as they triggered typescript warnings and the propTypes didn't cover any props that needed spreading. The onLoad and onError props were load bearing as they are used to handle gravatar fallbacks.
1 parent aba918a commit 64ee17f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/sentry/static/sentry/app/components/avatar/baseAvatar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ class BaseAvatar extends React.Component<Props, State> {
178178
gravatarId={gravatarId}
179179
round={round}
180180
remoteSize={DEFAULT_REMOTE_SIZE}
181+
{...eventProps}
181182
/>
182183
);
183184
}

src/sentry/static/sentry/app/components/avatar/gravatar.tsx

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ type Props = {
1616
* Should avatar be round instead of a square
1717
*/
1818
round?: boolean;
19+
onLoad?: () => void;
20+
onError?: () => void;
1921
};
2022

2123
type State = {
@@ -81,9 +83,16 @@ class Gravatar extends React.Component<Props, State> {
8183
return null;
8284
}
8385

84-
const {round} = this.props;
86+
const {round, onError, onLoad} = this.props;
8587

86-
return <Image round={round} src={this.buildGravatarUrl()} />;
88+
return (
89+
<Image
90+
round={round}
91+
src={this.buildGravatarUrl()}
92+
onLoad={onLoad}
93+
onError={onError}
94+
/>
95+
);
8796
}
8897
}
8998

0 commit comments

Comments
 (0)