update composer
This commit is contained in:
@@ -45,7 +45,7 @@ export const MentionNote = memo(function MentionNote({ id }: { id: string }) {
|
||||
) : status === 'success' ? (
|
||||
<>
|
||||
<User pubkey={data.pubkey} time={data.created_at} size="small" />
|
||||
<div className="mt-2">
|
||||
<div>
|
||||
{data.kind === 1 && <Kind1 content={data.content} truncate={true} />}
|
||||
{data.kind === 1063 && <Kind1063 metadata={data.tags} />}
|
||||
{data.kind !== 1 && data.kind !== 1063 && (
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
import * as Tooltip from '@radix-ui/react-tooltip';
|
||||
|
||||
import { usePublish } from '@libs/ndk';
|
||||
|
||||
import { RepostIcon } from '@shared/icons';
|
||||
|
||||
import { useComposer } from '@stores/composer';
|
||||
import { FULL_RELAYS } from '@stores/constants';
|
||||
|
||||
import { compactNumber } from '@utils/number';
|
||||
|
||||
@@ -15,13 +17,21 @@ export function NoteRepost({
|
||||
pubkey: string;
|
||||
reposts: number;
|
||||
}) {
|
||||
const setRepost = useComposer((state) => state.setRepost);
|
||||
const publish = usePublish();
|
||||
|
||||
const submit = async () => {
|
||||
const tags = [
|
||||
['e', id, FULL_RELAYS[0], 'root'],
|
||||
['p', pubkey],
|
||||
];
|
||||
await publish({ content: '', kind: 6, tags: tags });
|
||||
};
|
||||
|
||||
return (
|
||||
<Tooltip.Root delayDuration={150}>
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => setRepost(id, pubkey)}
|
||||
onClick={() => submit()}
|
||||
className="group group inline-flex h-6 w-20 items-center gap-1.5"
|
||||
>
|
||||
<Tooltip.Trigger asChild>
|
||||
|
||||
Reference in New Issue
Block a user