Sort by:
diff --git a/src/Posts/Menu.jsx b/src/Posts/Menu.jsx
index 38d48128..0973e232 100644
--- a/src/Posts/Menu.jsx
+++ b/src/Posts/Menu.jsx
@@ -1,137 +1,45 @@
-const accountId = props.accountId;
-const blockHeight = props.blockHeight;
-const parentFunctions = props.parentFunctions;
+const Item = styled.div`
+ padding: 0;
+ .btn {
+ width: 100%;
+ border:0;
+ text-align: left;
+ &:hover,
+ &:focus {
+ background-color: #ECEDEE;
+ text-decoration: none;
+ outline: none;
+ }
-const confirmationMessages = {
- hidePost: {
- header: "Post Hidden",
- detail: "This post will no longer be shown to you.",
- },
- hideAccount: {
- header: "Account Muted",
- detail: "All posts from this account will be no longer be shown to you.",
- },
- reportPost: {
- header: "Post Reported for Moderation",
- detail:
- "The item will no longer be shown to you and will be reviewed. Thanks for helping our Content Moderators.",
- },
- reportAccount: {
- header: "Account Reported for Moderation",
- detail:
- "All posts from this account will no longer be shown to you and will be reviewed. Thanks for helping our Content Moderators.",
- },
-};
-const moderatePost = (account, block, action, messageKey) => {
- const data = {
- moderate: {
- [account]: {
- ".post.main": {
- [block]: action,
- },
- },
- },
- };
- if (action === "report") {
- data.index = {
- moderation: JSON.stringify({
- key: "reported",
- value: {
- path: `${account}/post/main`,
- blockHeight: block,
- label: action,
- },
- }),
- };
- }
- Social.set(data, {
- onCommit: () => {
- parentFunctions.resolveHidePost(confirmationMessages[messageKey]);
- },
- });
-};
+ i {
+ color: #7E868C;
+ }
-const moderateAccount = (account, action, message) => {
- const data = {
- moderate: {
- [account]: action,
- },
- };
- if (action === "report") {
- data.index = {
- moderation: JSON.stringify({
- key: "reported",
- value: {
- path: account,
- label: action,
- },
- }),
- };
+ span {
+ font-weight: 500;
+ }
}
- Social.set(data, {
- onCommit: () => {
- alert(message);
- },
- });
-};
+`;
+
return (
- ,
- items: [
- {
- name: "Hide",
- iconLeft: "ph-bold ph-eye-slash",
- disabled: !context.accountId || context.accountId === accountId,
- subMenuProps: {
- items: [
- {
- name: "Hide this Post",
- iconLeft: "ph-bold ph-eye-slash",
- onSelect: () =>
- moderatePost(accountId, blockHeight, "hide", "hidePost"),
- },
- {
- name: "Mute " + accountId,
- iconLeft: "ph-bold ph-ear-slash",
- onSelect: () =>
- moderateAccount(accountId, "hide", "hideAccount"),
- },
- ],
- },
- },
- {
- name: (
- <>
-
- Report
- >
- ),
- disabled: !context.accountId || context.accountId === accountId,
- subMenuProps: {
- items: [
- {
- name: "Report this Post",
- iconLeft: "ph-bold ph-warning-octagon",
- onSelect: () =>
- moderatePost(accountId, blockHeight, "report", "reportPost"),
- },
- {
- name: "Report " + accountId,
- iconLeft: "ph-bold ph-warning-octagon",
- onSelect: () =>
- moderateAccount(accountId, "report", "reportAccount"),
- },
- ],
- },
- },
- // {
- // name: "Edit",
- // iconLeft: "ph-bold ph-pencil me-1",
- // onSelect: parentFunctions.toggleEdit,
- // },
- ],
- }}
- />
-);
+
+
+
+
+ {props.elements.map(e => {
+ return (-
+
-
+ {e}
+
+ )
+ })}
+
+
+)
\ No newline at end of file
diff --git a/src/Posts/Post.jsx b/src/Posts/Post.jsx
index cd359f6b..535ecb89 100644
--- a/src/Posts/Post.jsx
+++ b/src/Posts/Post.jsx
@@ -10,8 +10,6 @@ const showFlagAccountFeature = props.showFlagAccountFeature;
State.init({
hasBeenFlagged: false,
- showFlaggedToast: false,
- flaggedMessage: { header: "", detail: "" },
postExists: true,
comments: props.comments ?? undefined,
content: JSON.parse(props.content) ?? undefined,
@@ -173,14 +171,6 @@ const CommentWrapper = styled.div`
}
`;
-const resolveHidePost = (message) => {
- State.update({
- hasBeenFlagged: true,
- showFlaggedToast: true,
- flaggedMessage: message,
- });
-};
-
const renderComment = (a) => {
return (
@@ -206,11 +196,12 @@ if (state.hasBeenFlagged) {
src={`${REPL_ACCOUNT}/widget/DIG.Toast`}
props={{
type: "info",
- title: state.flaggedMessage.header,
- description: state.flaggedMessage.detail,
- open: state.showFlaggedToast,
+ title: "Flagged for moderation",
+ description:
+ "Thanks for helping our Content Moderators. The item you flagged will be reviewed.",
+ open: state.hasBeenFlagged,
onOpenChange: () => {
- State.update({ showFlaggedToast: false });
+ State.update({ hasBeenFlagged: false });
},
duration: 5000,
}}
@@ -255,19 +246,19 @@ return (
/>
-
+ {false && (
+
+ Edit
+ ,
+ ],
}}
/>
-
+ )}
@@ -336,6 +327,16 @@ return (
url: postUrl,
}}
/>
+ {
+ State.update({ hasBeenFlagged: true });
+ },
+ }}
+ />
)}
{state.showReply && (