[Utopian Dev] Enable Moderator to Edit Category Inline

Words
80
Reading
1 min
Listen
Play
9y

image.png

This is an installment for the implementation of the feature of adding inline edit functionalities for moderators. This is an implementation in partnership with sirfreeman@sirfreeman.

New Features

  • Enabled Moderator to Edit Contribution Category Inline

moderator-inline-edit-category.gif

  export const moderatorAction = (
      author,
      permlink,
      moderator,
      status,
      questions = [],
      score = 0,
      type,
    ) => dispatch => dispatch(
        moderatorActionRequest(
            author,
            permlink,
            moderator,
            status,
            questions,
            score,
            type,
        )
    );

Added the type (category type) parameter to moderatorActionRequest(). This will pass the new (selected) category type to the backend API.

      <span className={`Contribution__c-${(fullMode === false) ? type : "yes-full"}`}>
        <CategoryIcon from="from-story" type={type}/>
        { isModerator ?
          <InlineCategoryEdit
            value={type}
            types={types}
            post={post}
            moderatorAction={moderatorAction}
            user={user}
          /> :
          categorySlug(type)
        }
      </span>

Added condition to display inline editor when user is a moderator.

Component to display the category inline editor.



Posted on Utopian.io - Rewarding Open Source Contributors

[Utopian Dev] Enable Moderator to Edit Category Inline | Ecency