Add user stats to user recomendations in edit box

This commit is contained in:
Bojan Mojsilovic 2024-01-18 14:32:20 +01:00
parent 487fce7432
commit bcc1fc57a3
3 changed files with 15 additions and 13 deletions

View File

@ -38,6 +38,7 @@ import { useMediaContext } from "../../../contexts/MediaContext";
import { hookForDev } from "../../../lib/devTools";
import ButtonPrimary from "../../Buttons/ButtonPrimary";
import ButtonSecondary from "../../Buttons/ButtonSecondary";
import { useProfileContext } from "../../../contexts/ProfileContext";
type AutoSizedTextArea = HTMLTextAreaElement & { _baseScrollHeight: number };
@ -58,6 +59,7 @@ const EditBox: Component<{
const search = useSearchContext();
const account = useAccountContext();
const toast = useToastContext();
const profile = useProfileContext();
let textArea: HTMLTextAreaElement | undefined;
let textPreview: HTMLDivElement | undefined;
@ -1212,7 +1214,7 @@ const EditBox: Component<{
title={userName(user)}
description={nip05Verification(user)}
icon={<Avatar user={user} size="xs" />}
statNumber={search?.scores[user.pubkey]}
statNumber={profile?.profileHistory.stats[user.pubkey]?.followers_count || search?.scores[user.pubkey]}
statLabel={intl.formatMessage(tSearch.followers)}
onClick={() => selectUser(user)}
highlighted={highlightedUser() === index()}

View File

@ -1,5 +1,5 @@
import { A } from "@solidjs/router";
import { Component, createSignal, JSXElement, onMount, Show } from "solid-js";
import { Component, JSXElement } from "solid-js";
import { hookForDev } from "../../../lib/devTools";
import { nip05Verification, userName } from "../../../stores/profile";
import { PrimalUser } from "../../../types/primal";
@ -35,18 +35,18 @@ const MentionedUserLink: Component<{
return (
<LinkComponent>
@{userName(props.user)}
<div class={styles.userPreview}>
<Avatar user={props.user} />
<div>
<div class={styles.userName}>
{userName(props.user)}
<VerificationCheck user={props.user} />
</div>
<div class={styles.verification}>
{nip05Verification(props.user)}
</div>
<div class={styles.userPreview}>
<Avatar user={props.user} />
<div>
<div class={styles.userName}>
{userName(props.user)}
<VerificationCheck user={props.user} />
</div>
<div class={styles.verification}>
{nip05Verification(props.user)}
</div>
</div>
</div>
</LinkComponent>
);
}

View File

@ -1014,7 +1014,7 @@ const Messages: Component = () => {
title={userName(user)}
description={user.nip05}
icon={<Avatar user={user} size="xs" />}
statNumber={search?.scores[user.pubkey]}
statNumber={profile?.profileHistory.stats[user.pubkey]?.followers_count || search?.scores[user.pubkey]}
statLabel={intl.formatMessage(tSearch.followers)}
onClick={() => selectUser(user)}
highlighted={highlightedUser() === index()}