From ab67f6e257f6e8f08145a02a7b93550f99641be4 Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Sun, 18 Jun 2017 14:42:32 -0400 Subject: PLT-6215 Major post list refactor (#6501) * Major post list refactor * Fix post and thread deletion * Fix preferences not selecting correctly * Fix military time displaying * Fix UP key for editing posts * Fix ESLint error * Various fixes and updates per feedback * Fix for permalink view * Revert to old scrolling method and various fixes * Add floating timestamp, new message indicator, scroll arrows * Update post loading for focus mode and add visibility limit * Fix pinning posts and a react warning * Add loading UI updates from Asaad * Fix refreshing loop * Temporarily bump post visibility limit * Update infinite scrolling * Remove infinite scrolling --- webapp/components/dot_menu/dot_menu_item.jsx | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'webapp/components/dot_menu/dot_menu_item.jsx') diff --git a/webapp/components/dot_menu/dot_menu_item.jsx b/webapp/components/dot_menu/dot_menu_item.jsx index ceda0a1a4..6411beafb 100644 --- a/webapp/components/dot_menu/dot_menu_item.jsx +++ b/webapp/components/dot_menu/dot_menu_item.jsx @@ -5,7 +5,6 @@ import React from 'react'; import {FormattedMessage} from 'react-intl'; import PropTypes from 'prop-types'; -import {unpinPost, pinPost} from 'actions/post_actions.jsx'; import {showGetPostLinkModal, showDeletePostModal} from 'actions/global_actions.jsx'; import * as Utils from 'utils/utils.jsx'; import Constants from 'utils/constants.jsx'; @@ -18,12 +17,12 @@ export default function DotMenuItem(props) { function handleUnpinPost(e) { e.preventDefault(); - unpinPost(props.post.channel_id, props.post.id); + props.actions.unpinPost(props.post.id); } function handlePinPost(e) { e.preventDefault(); - pinPost(props.post.channel_id, props.post.id); + props.actions.pinPost(props.post.id); } function handleDeletePost(e) { @@ -98,7 +97,20 @@ DotMenuItem.propTypes = { post: PropTypes.object, handleOnClick: PropTypes.func, type: PropTypes.string, - commentCount: PropTypes.number + commentCount: PropTypes.number, + + actions: PropTypes.shape({ + + /* + * Function to pin the post + */ + pinPost: PropTypes.func, + + /* + * Function to unpin the post + */ + unpinPost: PropTypes.func + }) }; DotMenuItem.defaultProps = { -- cgit v1.2.3-1-g7c22