Skip to content

Commit

Permalink
Merge pull request #817 from near/jh/removePromote
Browse files Browse the repository at this point in the history
chore: remove promote from action menu
  • Loading branch information
jackson-harris-iii authored May 22, 2024
2 parents 8170ea1 + 7c8a5e3 commit b95b140
Showing 1 changed file with 0 additions and 58 deletions.
58 changes: 0 additions & 58 deletions src/Posts/Menu.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
{
Expand All @@ -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",
Expand Down Expand Up @@ -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;
};

Expand Down

0 comments on commit b95b140

Please sign in to comment.