Conform more of the codebase to strict typescript (#10841)

This commit is contained in:
Michael Telatynski 2023-05-25 09:39:23 +01:00 committed by GitHub
parent af78a5a2f5
commit 277a3c0146
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 89 additions and 60 deletions

View file

@ -126,19 +126,23 @@ export default class NotificationBadge extends React.PureComponent<XOR<IProps, I
tooltip = <Tooltip className="mx_NotificationBadge_tooltip" label={label} />;
}
return (
<StatelessNotificationBadge
label={label}
symbol={notification.symbol}
count={notification.count}
color={notification.color}
onClick={onClick}
onMouseOver={this.onMouseOver}
onMouseLeave={this.onMouseLeave}
tabIndex={tabIndex}
>
{tooltip}
</StatelessNotificationBadge>
);
const commonProps: React.ComponentProps<typeof StatelessNotificationBadge> = {
label,
symbol: notification.symbol,
count: notification.count,
color: notification.color,
onMouseOver: this.onMouseOver,
onMouseLeave: this.onMouseLeave,
};
if (onClick) {
return (
<StatelessNotificationBadge {...commonProps} onClick={onClick} tabIndex={tabIndex}>
{tooltip}
</StatelessNotificationBadge>
);
}
return <StatelessNotificationBadge {...commonProps}>{tooltip}</StatelessNotificationBadge>;
}
}