From 7c8a5e377bd27c0022846771e17b116f713ecb89 Mon Sep 17 00:00:00 2001 From: "jackson@near.org" Date: Tue, 14 May 2024 11:27:06 -0700 Subject: [PATCH] chore: remove promote from action menu --- src/Posts/Menu.jsx | 58 ---------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/src/Posts/Menu.jsx b/src/Posts/Menu.jsx index 0d7fbcc0..4542e00e 100644 --- a/src/Posts/Menu.jsx +++ b/src/Posts/Menu.jsx @@ -77,45 +77,6 @@ const moderate = (account, block, messageKey, action) => { }); }; -const promoteToBlog = () => { - if (state.loading) { - return; - } - - if (!context.accountId && props.requestAuthentication) { - props.requestAuthentication(); - return; - } else if (!context.accountId) { - return; - } - - State.update({ - loading: true, - }); - - const data = { - index: { - promote: JSON.stringify({ - key: context.accountId, - value: { - operation: "add", - type: "blog", - post: item, - blockHeight, - }, - }), - }, - }; - - Social.set(data, { - onCommit: () => State.update({ loading: false }), - onCancel: () => - State.update({ - loading: false, - }), - }); -}; - const buildMenu = (accountId, blockHeight) => { const hideSubmenu = [ { @@ -133,15 +94,7 @@ const buildMenu = (accountId, blockHeight) => { }, ]; - const promoteToBlogSubmenu = []; - if (blockHeight) { - promoteToBlogSubmenu.unshift({ - name: `Promote this ${capitalizedContentType} to Blog`, - iconLeft: "ph-bold ph-article", - onSelect: () => promoteToBlog(accountId, blockHeight), - }); - hideSubmenu.unshift({ name: "Hide this " + capitalizedContentType, iconLeft: "ph-bold ph-eye-slash", @@ -181,17 +134,6 @@ const buildMenu = (accountId, blockHeight) => { // }, ]; - if (item.path && item?.path?.includes("post/main")) { - menu.unshift({ - name: "Promote", - iconLeft: "ph-bold ph-arrow-up", - disabled: !context.accountId, - subMenuProps: { - items: promoteToBlogSubmenu, - }, - }); - } - return menu; };