diff --git a/components/Mention.tsx b/components/Mention.tsx index 8a0a499d..c9f5f252 100644 --- a/components/Mention.tsx +++ b/components/Mention.tsx @@ -258,6 +258,7 @@ export function MentionAutocomplete(props: { onMouseDown={(e) => e.preventDefault()} displayName={result.displayName} handle={result.handle} + avatar={result.avatar} selected={index === suggestionIndex} /> ) : result.type === "publication" ? ( @@ -268,6 +269,7 @@ export function MentionAutocomplete(props: { }} onMouseDown={(e) => e.preventDefault()} pubName={result.name} + uri={result.uri} selected={index === suggestionIndex} onPostsClick={() => { handleScopeChange({ @@ -302,6 +304,7 @@ export function MentionAutocomplete(props: { const Result = (props: { result: React.ReactNode; subtext?: React.ReactNode; + icon?: React.ReactNode; onClick: () => void; onMouseDown: (e: React.MouseEvent) => void; selected?: boolean; @@ -309,7 +312,7 @@ const Result = (props: { return ( ); }; @@ -357,21 +363,36 @@ const ScopeButton = (props: { const DidResult = (props: { displayName?: string; handle: string; + avatar?: string; onClick: () => void; onMouseDown: (e: React.MouseEvent) => void; selected?: boolean; }) => { return ( + ) : ( +
+ ) + } result={props.displayName ? props.displayName : props.handle} subtext={props.displayName && `@${props.handle}`} - {...props} + onClick={props.onClick} + onMouseDown={props.onMouseDown} + selected={props.selected} /> ); }; const PublicationResult = (props: { pubName: string; + uri: string; onClick: () => void; onMouseDown: (e: React.MouseEvent) => void; selected?: boolean; @@ -379,6 +400,13 @@ const PublicationResult = (props: { }) => { return ( + } result={ <>
{props.pubName}
@@ -430,7 +458,7 @@ const ScopeHeader = (props: { }; export type Mention = - | { type: "did"; handle: string; did: string; displayName?: string } + | { type: "did"; handle: string; did: string; displayName?: string; avatar?: string } | { type: "publication"; uri: string; name: string } | { type: "post"; uri: string; title: string }; @@ -485,6 +513,7 @@ function useMentionSuggestions(query: string | null) { handle: actor.handle, did: actor.did, displayName: actor.displayName, + avatar: actor.avatar, })), ...publications.result.publications.map((p) => ({ type: "publication" as const,