@@ -10,15 +10,15 @@ import {
1010 Avatar ,
1111 ListItemText ,
1212 // ListItemSecondaryAction,
13- IconButton ,
13+ // IconButton,
1414 CardMedia ,
1515} from "@material-ui/core" ;
1616import { makeStyles } from "@material-ui/core/styles" ;
17- import { Button , Dropdown , FormControl } from "react-bootstrap" ;
17+ import { Button , Dropdown } from "react-bootstrap" ;
1818import AddEventModal from "./popups/AddEventModal" ;
1919import AddProjectModal from "./popups/AddProjectModal" ;
2020import PostReactionModal from "./popups/PostReactionsModal" ;
21- import ArrowDropUpIcon from "@material-ui/icons/ArrowDropUp" ;
21+ // import ArrowDropUpIcon from "@material-ui/icons/ArrowDropUp";
2222import ChatBubbleIcon from "@material-ui/icons/ChatBubble" ;
2323import "../../pinned-posts/posts/posts.scss" ;
2424import "./news-feed.scss" ;
@@ -35,15 +35,16 @@ import { withRouter } from "react-router-dom";
3535import { rsvpYes } from "../../../actions/eventAction" ;
3636import { FaEllipsisH , FaThumbtack } from "react-icons/fa" ;
3737import ReactionsElement from "./ReactionsElement" ;
38+ import { pinPost } from '../../../actions/postAction'
3839import Moment from "react-moment" ;
3940
40- const reactionVariant = {
41- hover : {
42- scale : 1.3 ,
43- opacity : 0.9 ,
44- rotate : [ 0 , 10 , 0 , - 10 , 0 ] ,
45- } ,
46- } ;
41+ // const reactionVariant = {
42+ // hover: {
43+ // scale: 1.3,
44+ // opacity: 0.9,
45+ // rotate: [0, 10, 0, -10, 0],
46+ // },
47+ // };
4748
4849const navStyles = { position : 'fixed' , width : '83%' , top : '0' , zIndex :1 , background : '#fff' , marginTop : '0px' , marginBottom :'0px' }
4950
@@ -193,10 +194,10 @@ function NewsFeed(props) {
193194 toggle ( ! showComment ) ;
194195 } ;
195196
196- let onUpvote = ( postId ) => {
197- console . log ( "upvote clicked!" , postId ) ;
198- props . upVotePost ( postId ) ;
199- } ;
197+ // let onUpvote = (postId) => {
198+ // console.log("upvote clicked!", postId);
199+ // props.upVotePost(postId);
200+ // };
200201
201202 let onRsvpYes = ( eventId ) => {
202203 console . log ( "On rsvp yes " , eventId ) ;
@@ -221,6 +222,11 @@ function NewsFeed(props) {
221222 setShowReactions ( false ) ;
222223 } ;
223224
225+ let onPinPost = ( postId ) => {
226+ console . log ( 'Pinning post ' , postId )
227+ props . pinPost ( postId )
228+ }
229+
224230 useEffect ( ( ) => {
225231 if ( Object . keys ( votes ) . length !== 0 ) {
226232 setShowReactions ( true ) ;
@@ -279,7 +285,10 @@ function NewsFeed(props) {
279285 </ h2 >
280286 < Moment format = "DD MMM YYYY" > { post ?. createdAt } </ Moment >
281287 </ ListItemText >
282- < FaThumbtack style = { { margin : "10px" , width : "10px" } } />
288+ < FaThumbtack
289+ style = { { margin : "10px" , width : "10px" , cursor : "pointer" } }
290+ onClick = { ( ) => onPinPost ( post . _id ) }
291+ />
283292 < Dropdown >
284293 < Dropdown . Toggle
285294 as = { CustomToggle }
@@ -631,5 +640,6 @@ const mapStateToProps = (state) => ({
631640export default connect ( mapStateToProps , {
632641 getAllCommentsOfPost,
633642 upVotePost,
643+ pinPost,
634644 rsvpYes,
635645} ) ( withRouter ( NewsFeed ) ) ;
0 commit comments