@@ -14,7 +14,7 @@ import {
1414 CardMedia ,
1515} from "@material-ui/core" ;
1616import { makeStyles } from "@material-ui/core/styles" ;
17- import { Button , } from "react-bootstrap" ;
17+ import { Button , Dropdown , FormControl } from "react-bootstrap" ;
1818import AddEventModal from "./popups/AddEventModal" ;
1919import AddProjectModal from "./popups/AddProjectModal" ;
2020import ArrowDropUpIcon from "@material-ui/icons/ArrowDropUp" ;
@@ -32,6 +32,33 @@ import eventImg2 from "../../../svgs/event-img-2.svg";
3232import parse from "html-react-parser" ;
3333import { withRouter } from 'react-router-dom'
3434import { rsvpYes } from '../../../actions/eventAction'
35+ import Like from "../../../images/Like.png" ;
36+ import Heart from "../../../images/Heart.png" ;
37+ import Happy from "../../../images/Happy.png" ;
38+ import DonutReaction from "../../../images/DonutReaction.png" ;
39+ import { motion } from 'framer-motion' ;
40+ import { FaEllipsisH } from 'react-icons/fa'
41+
42+ const reactionVariant = {
43+ hover : {
44+ scale : 1.3 ,
45+ opacity : 0.9 ,
46+ rotate : [ 0 , 10 , 0 , - 10 , 0 ] ,
47+ }
48+ }
49+
50+ const CustomToggle = React . forwardRef ( ( { children, onClick } , ref ) => (
51+ < a
52+ href = ""
53+ ref = { ref }
54+ onClick = { ( e ) => {
55+ e . preventDefault ( ) ;
56+ onClick ( e ) ;
57+ } }
58+ >
59+ { children }
60+ </ a >
61+ ) ) ;
3562
3663const styles = makeStyles ( ( theme ) => ( {
3764 root : {
@@ -91,6 +118,8 @@ const styles = makeStyles((theme) => ({
91118 } ,
92119} ) ) ;
93120
121+
122+
94123function NewsFeed ( props ) {
95124 const classes = styles ( ) ;
96125 const [ type , changeType ] = useState ( "All" ) ;
@@ -103,9 +132,11 @@ function NewsFeed(props) {
103132 const [ events , setEvents ] = useState ( [ ] ) ;
104133 const [ projects , setAllProjects ] = useState ( [ ] ) ;
105134 const [ posts , setAllPosts ] = useState ( [ ] ) ;
135+ const [ displayReactionContainer , setDisplayReactioContainer ] = useState ( false )
106136
107137 useEffect ( ( ) => {
108138 console . log ( "useEffect from news-feed " , props ) ;
139+ console . log ( 'USEEEEERRRRRRR' , props . userId )
109140 setEvents ( props ?. allEvents ) ;
110141 setAllProjects ( props ?. allProjects ) ;
111142 setAllPosts ( props ?. allPosts ) ;
@@ -182,17 +213,49 @@ function NewsFeed(props) {
182213 < h2 > { post ?. userId ?. name ?. firstName + " " + post ?. userId ?. name ?. lastName } </ h2 >
183214 < small > { post ?. createdAt } </ small >
184215 </ ListItemText >
216+ < Dropdown >
217+ < Dropdown . Toggle as = { CustomToggle } id = "dropdown-custom-components" >
218+ < FaEllipsisH />
219+ </ Dropdown . Toggle >
220+ < Dropdown . Menu >
221+ < Dropdown . Item eventKey = "1" > Edit</ Dropdown . Item >
222+ < Dropdown . Item eventKey = "2" > Share</ Dropdown . Item >
223+ < Dropdown . Item eventKey = "3" > Delete</ Dropdown . Item >
224+ </ Dropdown . Menu >
225+ </ Dropdown >
185226 </ ListItem >
186227 < div className = "post-details2" > { parse ( post ?. content ) } </ div >
187228 < ListItem >
188- < IconButton
229+ { /* <IconButton
189230 className={classes.vote}
190231 onClick={() => onUpvote(post._id)}
191232 >
192233 <ArrowDropUpIcon className="up-vote" />
193234 </IconButton>
194235 <span className="up-vote">{post?.votes?.upVotes?.user.length}</span>
195- < span className = "space" > </ span >
236+ <span className="space"></span> */ }
237+ < div className = "reactions-container" >
238+ < div className = "reaction-element" >
239+ < motion . img src = { Like } alt = "like-reaction" variants = { reactionVariant }
240+ whileHover = "hover"
241+ > </ motion . img >
242+ </ div >
243+ < div className = "reaction-element" >
244+ < motion . img src = { Happy } alt = "happy-reaction" variants = { reactionVariant }
245+ whileHover = "hover"
246+ > </ motion . img >
247+ </ div >
248+ < div className = "reaction-element" >
249+ < motion . img src = { Heart } alt = "heart-reaction" variants = { reactionVariant }
250+ whileHover = "hover"
251+ > </ motion . img >
252+ </ div >
253+ < div className = "reaction-element" >
254+ < motion . img src = { DonutReaction } alt = "donut-reaction" variants = { reactionVariant }
255+ whileHover = "hover"
256+ > </ motion . img >
257+ </ div >
258+ </ div >
196259 < span className = "com-btn" >
197260 < ChatBubbleIcon className = { classes . chat } />
198261 < Button
@@ -532,7 +595,8 @@ const mapStateToProps = (state) => ({
532595 event : state . event ,
533596 post : state . post ,
534597 status : state . status ,
535- comment : state . comment
598+ comment : state . comment ,
599+ userId : state . user . userProfile . _id
536600} )
537601
538602export default connect ( mapStateToProps , {
0 commit comments