diff --git a/src/shared/notes/kind1.tsx b/src/shared/notes/kind1.tsx
index f9e4f9f9..ced00626 100644
--- a/src/shared/notes/kind1.tsx
+++ b/src/shared/notes/kind1.tsx
@@ -10,8 +10,12 @@ export function Kind1({
}: { content: any; truncate?: boolean }) {
return (
<>
-
- {truncate ? truncateContent(content.original, 100) : content.parsed}
+
+ {content.parsed}
{Array.isArray(content.images) && content.images.length ? (
diff --git a/src/shared/notes/metadata/repost.tsx b/src/shared/notes/metadata/repost.tsx
index 6ddd689b..d146528e 100644
--- a/src/shared/notes/metadata/repost.tsx
+++ b/src/shared/notes/metadata/repost.tsx
@@ -1,49 +1,18 @@
-import { NDKEvent, NDKPrivateKeySigner } from "@nostr-dev-kit/ndk";
import { RepostIcon } from "@shared/icons";
-import { RelayContext } from "@shared/relayProvider";
-import { useActiveAccount } from "@stores/accounts";
-import { dateToUnix } from "@utils/date";
+import { useComposer } from "@stores/composer";
import { compactNumber } from "@utils/number";
-import { useContext, useState } from "react";
export function NoteRepost({
id,
pubkey,
reposts,
}: { id: string; pubkey: string; reposts: number }) {
- const ndk = useContext(RelayContext);
- const account = useActiveAccount((state: any) => state.account);
-
- const [count, setCount] = useState(reposts);
-
- const submitEvent = (e: any) => {
- e.stopPropagation();
-
- const signer = new NDKPrivateKeySigner(account.privkey);
- ndk.signer = signer;
-
- const event = new NDKEvent(ndk);
- // build event
- event.content = "";
- event.kind = 6;
- event.created_at = dateToUnix();
- event.pubkey = account.pubkey;
- event.tags = [
- ["e", id],
- ["p", pubkey],
- ];
-
- // publish event
- event.publish();
-
- // update state
- setCount(count + 1);
- };
+ const setRepost = useComposer((state: any) => state.setRepost);
return (
);
diff --git a/src/shared/user.tsx b/src/shared/user.tsx
index 104db9bb..297cd5ae 100644
--- a/src/shared/user.tsx
+++ b/src/shared/user.tsx
@@ -27,12 +27,14 @@ export function User({
}`}
>
diff --git a/src/stores/composer.tsx b/src/stores/composer.tsx
new file mode 100644
index 00000000..77b58ec8
--- /dev/null
+++ b/src/stores/composer.tsx
@@ -0,0 +1,20 @@
+import { create } from "zustand";
+
+export const useComposer = create((set) => ({
+ open: false,
+ repost: { id: null, pubkey: null },
+ reply: null,
+ toggleModal: (status: boolean) => {
+ set({ open: status });
+ if (!status) {
+ set({ repost: { id: null, pubkey: null } });
+ }
+ },
+ setRepost: (id: string, pubkey: string) => {
+ set({ repost: { id: id, pubkey: pubkey } });
+ set({ open: true });
+ },
+ clearRepost: () => {
+ set({ repost: { id: null, pubkey: null } });
+ },
+}));
diff --git a/src/stores/constants.tsx b/src/stores/constants.tsx
index 58ac036d..d6b4c69d 100644
--- a/src/stores/constants.tsx
+++ b/src/stores/constants.tsx
@@ -1,6 +1,6 @@
export const APP_VERSION = "1.0.0";
-export const DEFAULT_AVATAR = "https://void.cat/d/PZcdCxNc24rCCxV8QXbdFQ";
+export const DEFAULT_AVATAR = "https://void.cat/d/5VKmKyuHyxrNMf9bWSVPih";
export const OPENGRAPH_KEY = "9EJG4SY-19Q4M5J-H8R29C9-091XPCC";