feat: improve performance (#234)
* feat: use negentropy as much as possible * update * update
This commit is contained in:
@@ -15,8 +15,7 @@ export function UserAvatar({ className }: { className?: string }) {
|
||||
|
||||
const picture = useMemo(() => {
|
||||
if (service?.length && user.profile?.picture?.length) {
|
||||
const url = `${service}?url=${user.profile?.picture}&w=100&h=100&default=1&n=-1`;
|
||||
return url;
|
||||
return `${service}?url=${user.profile?.picture}&w=100&h=100&n=-1&default=${user.profile?.picture}`;
|
||||
} else {
|
||||
return user.profile?.picture;
|
||||
}
|
||||
|
||||
@@ -59,10 +59,10 @@ export function UserFollowButton({ className }: { className?: string }) {
|
||||
type="button"
|
||||
disabled={isPending}
|
||||
onClick={() => toggleFollow()}
|
||||
className={cn("w-max", className)}
|
||||
className={cn("w-max gap-1", className)}
|
||||
>
|
||||
{isError ? "Error" : null}
|
||||
{isPending || isLoading ? <Spinner className="size-4" /> : null}
|
||||
{isPending || isLoading ? <Spinner className="size-3" /> : null}
|
||||
{isFollow ? "Unfollow" : "Follow"}
|
||||
</button>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user