From f11f9fb884119db87097d000d8599e7bb59ecd2d Mon Sep 17 00:00:00 2001 From: dusk Date: Sat, 23 Mar 2024 03:32:19 -0400 Subject: [PATCH 1/2] spelling correction --- src/components/Note/NoteContextMenu.tsx | 2 +- src/translations.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/Note/NoteContextMenu.tsx b/src/components/Note/NoteContextMenu.tsx index e517a582..388883ce 100644 --- a/src/components/Note/NoteContextMenu.tsx +++ b/src/components/Note/NoteContextMenu.tsx @@ -195,7 +195,7 @@ const NoteContextMenu: Component<{ icon: 'copy_raw_data', }, { - label: intl.formatMessage(tActions.noteContext.breadcast), + label: intl.formatMessage(tActions.noteContext.broadcast), action: broadcastNote, icon: 'broadcast', }, diff --git a/src/translations.ts b/src/translations.ts index 95c6b798..8d3305e4 100644 --- a/src/translations.ts +++ b/src/translations.ts @@ -400,8 +400,8 @@ export const actions = { defaultMessage: 'Copy user public key', description: 'Label for copy note author\'s pubkey from context menu', }, - breadcast: { - id: 'actions.noteContext.breadcast', + broadcast: { + id: 'actions.noteContext.broadcast', defaultMessage: 'Broadcast note', description: 'Label for note broadcast from context menu', }, From 5f7c7c0fe003a5e05591d4ad2c23a9f546816e53 Mon Sep 17 00:00:00 2001 From: dusk Date: Sat, 23 Mar 2024 15:50:47 -0400 Subject: [PATCH 2/2] add follow/unfollow button in note context --- src/components/Note/NoteContextMenu.tsx | 10 +++++++++- src/translations.ts | 10 ++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/src/components/Note/NoteContextMenu.tsx b/src/components/Note/NoteContextMenu.tsx index 388883ce..1129e0a0 100644 --- a/src/components/Note/NoteContextMenu.tsx +++ b/src/components/Note/NoteContextMenu.tsx @@ -208,8 +208,17 @@ const NoteContextMenu: Component<{ const noteContextForOtherPeople: () => MenuItem[] = () => { const isMuted = account?.muted.includes(note()?.user.pubkey); + const isFollowed = account?.following.includes(note()?.post.pubkey); return [ + { + label: isFollowed? intl.formatMessage(tActions.noteContext.unFollowAuthor): intl.formatMessage(tActions.noteContext.followAuthor), + action: () => { + isFollowed? account?.actions.removeFollow(note()?.post.pubkey) : account?.actions.addFollow(note()?.post.pubkey); + props.onClose() + }, + icon: 'default_avatar', + }, { label: isMuted ? intl.formatMessage(tActions.noteContext.unmuteAuthor) : intl.formatMessage(tActions.noteContext.muteAuthor), action: () => { @@ -258,7 +267,6 @@ const NoteContextMenu: Component<{ }} onAbort={() => setConfirmMuteUser(false)} /> -