perf: Replace un-needed context fetching (#10657)
* Replace ctx.user.credentials to fetch in their own usecases * Remove rawavatar from return * Remove avatar rawAvatar from handler * Fix fallback avatars * fix: profile.slug already includes /team * perf: Deprecate useAvatarQuery hook * Extract to reusable credential func * Fix type errors for credentials * credentialOwner was inferred incorrectly, string non-nullable --------- Co-authored-by: Keith Williams <[email protected]> Co-authored-by: Alex van Andel <[email protected]>
This commit is contained in:
18 files changed
+84
-62
No files matched your search
@@ -52,9 +52,14 @@ export function Avatar(props: AvatarProps) {
|
||||
/>
|
||||
<AvatarPrimitive.Fallback delayMs={600} asChild={props.asChild} className="flex items-center">
|
||||
<>
|
||||
{props.fallback && !gravatarFallbackMd5 && props.fallback}
|
||||
{gravatarFallbackMd5 && (
|
||||
<img src={defaultAvatarSrc({ md5: gravatarFallbackMd5 })} alt={alt} className={rootClass} />
|
||||
{props.fallback ? (
|
||||
props.fallback
|
||||
) : (
|
||||
<img
|
||||
src={defaultAvatarSrc({ md5: gravatarFallbackMd5 ?? "fallback" })}
|
||||
alt={alt}
|
||||
className={rootClass}
|
||||
/>
|
||||
)}
|
||||
</>
|
||||
</AvatarPrimitive.Fallback>
|
||||
|
||||
Reference in new issue
Block a user