small fixes

This commit is contained in:
Ren Amamiya
2023-08-18 17:42:25 +07:00
parent 5626579b3f
commit c85502e427
10 changed files with 236 additions and 226 deletions

View File

@@ -1,3 +1,5 @@
import { useStorage } from '@libs/storage/provider';
import { widgetKinds } from '@stores/constants';
import { useWidgets } from '@stores/widgets';
@@ -5,14 +7,16 @@ import { useProfile } from '@utils/hooks/useProfile';
import { displayNpub } from '@utils/shortenKey';
export function MentionUser({ pubkey }: { pubkey: string }) {
const { db } = useStorage();
const { user } = useProfile(pubkey);
const setWidget = useWidgets((state) => state.setWidget);
return (
<button
type="button"
onClick={() =>
setWidget({
setWidget(db, {
kind: widgetKinds.user,
title: user?.nip05 || user?.name || user?.display_name,
content: pubkey,