mirror of
https://github.com/PrimalHQ/primal-web-app.git
synced 2024-10-03 02:10:55 +00:00
Add user stats to user recomendations in edit box
This commit is contained in:
parent
487fce7432
commit
bcc1fc57a3
@ -38,6 +38,7 @@ import { useMediaContext } from "../../../contexts/MediaContext";
|
|||||||
import { hookForDev } from "../../../lib/devTools";
|
import { hookForDev } from "../../../lib/devTools";
|
||||||
import ButtonPrimary from "../../Buttons/ButtonPrimary";
|
import ButtonPrimary from "../../Buttons/ButtonPrimary";
|
||||||
import ButtonSecondary from "../../Buttons/ButtonSecondary";
|
import ButtonSecondary from "../../Buttons/ButtonSecondary";
|
||||||
|
import { useProfileContext } from "../../../contexts/ProfileContext";
|
||||||
|
|
||||||
type AutoSizedTextArea = HTMLTextAreaElement & { _baseScrollHeight: number };
|
type AutoSizedTextArea = HTMLTextAreaElement & { _baseScrollHeight: number };
|
||||||
|
|
||||||
@ -58,6 +59,7 @@ const EditBox: Component<{
|
|||||||
const search = useSearchContext();
|
const search = useSearchContext();
|
||||||
const account = useAccountContext();
|
const account = useAccountContext();
|
||||||
const toast = useToastContext();
|
const toast = useToastContext();
|
||||||
|
const profile = useProfileContext();
|
||||||
|
|
||||||
let textArea: HTMLTextAreaElement | undefined;
|
let textArea: HTMLTextAreaElement | undefined;
|
||||||
let textPreview: HTMLDivElement | undefined;
|
let textPreview: HTMLDivElement | undefined;
|
||||||
@ -1212,7 +1214,7 @@ const EditBox: Component<{
|
|||||||
title={userName(user)}
|
title={userName(user)}
|
||||||
description={nip05Verification(user)}
|
description={nip05Verification(user)}
|
||||||
icon={<Avatar user={user} size="xs" />}
|
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)}
|
statLabel={intl.formatMessage(tSearch.followers)}
|
||||||
onClick={() => selectUser(user)}
|
onClick={() => selectUser(user)}
|
||||||
highlighted={highlightedUser() === index()}
|
highlighted={highlightedUser() === index()}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { A } from "@solidjs/router";
|
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 { hookForDev } from "../../../lib/devTools";
|
||||||
import { nip05Verification, userName } from "../../../stores/profile";
|
import { nip05Verification, userName } from "../../../stores/profile";
|
||||||
import { PrimalUser } from "../../../types/primal";
|
import { PrimalUser } from "../../../types/primal";
|
||||||
|
@ -1014,7 +1014,7 @@ const Messages: Component = () => {
|
|||||||
title={userName(user)}
|
title={userName(user)}
|
||||||
description={user.nip05}
|
description={user.nip05}
|
||||||
icon={<Avatar user={user} size="xs" />}
|
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)}
|
statLabel={intl.formatMessage(tSearch.followers)}
|
||||||
onClick={() => selectUser(user)}
|
onClick={() => selectUser(user)}
|
||||||
highlighted={highlightedUser() === index()}
|
highlighted={highlightedUser() === index()}
|
||||||
|
Loading…
Reference in New Issue
Block a user