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:
authored and GitHub committed 2023-08-10 18:07:09 +01:00
1 parent a153f9627d
commit 57384eb921
18 files changed
+84 -62

No files matched your search

+8 -3
View File
@@ -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>