small fixes and support $ boost sign

This commit is contained in:
Ren Amamiya
2023-09-28 07:29:05 +07:00
parent 7cef6efa6f
commit c80414a72d
8 changed files with 31 additions and 38 deletions

View File

@@ -1,11 +1,12 @@
import { memo } from 'react';
import { useStorage } from '@libs/storage/provider';
import { WidgetKinds, useWidgets } from '@stores/widgets';
import { useProfile } from '@utils/hooks/useProfile';
import { displayNpub } from '@utils/shortenKey';
export function MentionUser({ pubkey }: { pubkey: string }) {
export const MentionUser = memo(function MentionUser({ pubkey }: { pubkey: string }) {
const { db } = useStorage();
const { user } = useProfile(pubkey);
@@ -31,11 +32,12 @@ export function MentionUser({ pubkey }: { pubkey: string }) {
}
className="break-words text-fuchsia-400 hover:text-fuchsia-500"
>
{user?.name ||
user?.display_name ||
user?.displayName ||
user?.username ||
displayNpub(pubkey, 16)}
{'@' +
(user?.name ||
user?.display_name ||
user?.displayName ||
user?.username ||
'unknown')}
</span>
);
}
});