Skip to content

Commit

Permalink
handle approve/reject
Browse files Browse the repository at this point in the history
  • Loading branch information
Megha-Dev-19 committed Dec 30, 2023
1 parent 3ea8c5f commit f2acc8e
Show file tree
Hide file tree
Showing 2 changed files with 245 additions and 174 deletions.
18 changes: 14 additions & 4 deletions src/devhub/entity/post/Post.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -496,8 +496,16 @@ const isDraft =
(draftState?.edit_post_id === postId &&
draftState?.postType === state.postType);

const toggleEditor = () => {
State.update({ showEditor: !state.showEditor });
const setExpandReplies = (value) => {
State.update({ expandReplies: value });
};

const setEditorState = (value) => {
if (draftState && !value) {
// clear the draft state since user initiated cancel
onDraftStateChange(null);
}
State.update({ showEditor: value });
};

let amount = null;
Expand Down Expand Up @@ -537,8 +545,9 @@ function Editor() {
draftState?.parent_post_id == postId ? draftState : undefined,
parentId: postId,
mode: "Create",
toggleEditor: toggleEditor,
transactionHashes: props.transactionHashes,
setExpandReplies,
setEditorState: setEditorState,
}}
/>
</>
Expand All @@ -563,8 +572,9 @@ function Editor() {
onDraftStateChange,
draftState:
draftState?.edit_post_id == postId ? draftState : undefined,
toggleEditor: toggleEditor,
setEditorState: setEditorState,
transactionHashes: props.transactionHashes,
setExpandReplies,
}}
/>
</>
Expand Down
Loading

0 comments on commit f2acc8e

Please sign in to comment.