@@ -14,6 +14,7 @@ import {
1414 CardMedia ,
1515} from "@material-ui/core" ;
1616import { makeStyles } from "@material-ui/core/styles" ;
17+ import { Button } from "react-bootstrap" ;
1718import AddEventModal from "./popups/AddEventModal" ;
1819import AddProjectModal from "./popups/AddProjectModal" ;
1920import ArrowDropUpIcon from "@material-ui/icons/ArrowDropUp" ;
@@ -42,11 +43,11 @@ const styles = makeStyles((theme) => ({
4243 background : "#ffffff" ,
4344 border : "1px solid #cccccc" ,
4445 boxShadow : "1px 2px 5px rgba(0, 0, 0, 0.1)" ,
45- borderRadius : "5px"
46+ borderRadius : "5px" ,
4647 } ,
4748 listStyle2 : {
4849 paddingTop : 0 ,
49- marginTop : "-4px"
50+ marginTop : "-4px" ,
5051 } ,
5152 info : {
5253 position : "absolute" ,
@@ -84,7 +85,7 @@ const styles = makeStyles((theme) => ({
8485 reply : {
8586 color : "rgba(0, 0, 0, 0.4)" ,
8687 fontSize : "36px" ,
87- paddingLeft : "17px"
88+ paddingLeft : "17px" ,
8889 } ,
8990 paper : {
9091 marginBottom : "15px" ,
@@ -99,7 +100,7 @@ function NewsFeed(props) {
99100 const [ showEvent , setShowEvent ] = useState ( false ) ;
100101 const [ writePost , showPostModal ] = useState ( false ) ;
101102 const [ showComment , toggle ] = useState ( false ) ;
102- const [ commentId , setCommentId ] = useState ( '' ) ;
103+ const [ commentId , setCommentId ] = useState ( "" ) ;
103104 const [ events , setEvents ] = useState ( [ ] ) ;
104105 const [ projects , setAllProjects ] = useState ( [ ] ) ;
105106 const [ posts , setAllPosts ] = useState ( [ ] ) ;
@@ -112,7 +113,7 @@ function NewsFeed(props) {
112113 } , [ props . allEvents , props . allPosts , props . allProjects , props ] ) ;
113114
114115 let handleClick = ( atrb ) => ( ) => {
115- console . log ( ' attr ' , atrb ) ;
116+ console . log ( " attr " , atrb ) ;
116117 changeType ( atrb ) ;
117118 // second("s");
118119 } ;
@@ -124,7 +125,7 @@ function NewsFeed(props) {
124125 setShowEvent ( true ) ;
125126 }
126127 } ;
127-
128+
128129 let handleClose = ( modalName ) => {
129130 if ( modalName === "project" ) {
130131 setShowProject ( false ) ;
@@ -134,35 +135,35 @@ function NewsFeed(props) {
134135 } ;
135136
136137 let openPostModal = ( ) => {
137- showPostModal ( true )
138- }
138+ showPostModal ( true ) ;
139+ } ;
139140
140141 let closePostModal = ( ) => {
141- showPostModal ( false )
142- }
142+ showPostModal ( false ) ;
143+ } ;
143144
144145 let commentToggle = ( postId ) => {
145146 console . log ( "Comment toggle clicked!" , postId ) ;
146- props . getAllCommentsOfPost ( postId )
147+ props . getAllCommentsOfPost ( postId ) ;
147148 setCommentId ( postId ) ;
148149 toggle ( ! showComment ) ;
149- }
150+ } ;
150151
151152 let onUpvote = ( postId ) => {
152- console . log ( ' upvote clicked!' , postId ) ;
153- props . upVotePost ( postId )
154- }
153+ console . log ( " upvote clicked!" , postId ) ;
154+ props . upVotePost ( postId ) ;
155+ } ;
155156
156157 let onRsvpYes = ( eventId ) => {
157- console . log ( ' On rsvp yes ' , eventId ) ;
158+ console . log ( " On rsvp yes " , eventId ) ;
158159 const info = {
159- yes : localStorage . getItem ( ' userId' )
160- }
160+ yes : localStorage . getItem ( " userId" ) ,
161+ } ;
161162 props . rsvpYes ( eventId , info ) ;
162- }
163+ } ;
163164
164165 let onViewProject = ( projectId ) => {
165- console . log ( ' Redirecting to project ' , projectId ) ;
166+ console . log ( " Redirecting to project " , projectId ) ;
166167 props . history . push ( `/${ projectId } /proj-info` ) ;
167168 }
168169
@@ -173,7 +174,7 @@ function NewsFeed(props) {
173174
174175 let postContent = posts ?. map ( ( post ) => {
175176 return (
176- < div className = "grid" key = { post . _id } >
177+ < div className = "grid" key = { post . _id } >
177178 < Paper elevation = { 1 } className = { classes . paper } >
178179 < Card className = { classes . root } >
179180 < List className = { classes . listStyle } >
@@ -196,13 +197,15 @@ function NewsFeed(props) {
196197 </ ListItem >
197198 < div className = "post-details2" > { parse ( post ?. content ) } </ div >
198199 < ListItem >
199- < IconButton
200+ < IconButton
200201 className = { classes . vote }
201202 onClick = { ( ) => onUpvote ( post . _id ) }
202- >
203+ >
203204 < ArrowDropUpIcon className = "up-vote" />
204205 </ IconButton >
205- < span className = "up-vote" > { post ?. votes ?. upVotes ?. user . length } </ span >
206+ < span className = "up-vote" >
207+ { post ?. votes ?. upVotes ?. user . length }
208+ </ span >
206209 < span className = "space" > </ span >
207210 < span className = "com-btn" >
208211 < ChatBubbleIcon className = { classes . chat } />
@@ -218,8 +221,8 @@ function NewsFeed(props) {
218221 </ Card >
219222 </ Paper >
220223 </ div >
221- )
222- } )
224+ ) ;
225+ } ) ;
223226
224227 let projectsContent = projects ?. map ( ( project ) => {
225228 return (
@@ -345,16 +348,16 @@ function NewsFeed(props) {
345348 )
346349 } )
347350
348- let content ;
349- if ( type === "Project" ) {
350- content = projectsContent
351- }
352- if ( type === "Post" ) {
353- content = postContent
354- }
355- if ( type === "Event" ) {
356- content = eventsContent
357- }
351+ let content ;
352+ if ( type === "Project" ) {
353+ content = projectsContent ;
354+ }
355+ if ( type === "Post" ) {
356+ content = postContent ;
357+ }
358+ if ( type === "Event" ) {
359+ content = eventsContent ;
360+ }
358361
359362 return (
360363 < >
@@ -540,18 +543,18 @@ function NewsFeed(props) {
540543 ) ;
541544}
542545
543- // map state to props
546+ // map state to props
544547const mapStateToProps = ( state ) => ( {
545548 auth : state . auth ,
546549 error : state . error ,
547550 event : state . event ,
548551 post : state . post ,
549552 status : state . status ,
550- comment : state . comment
551- } )
553+ comment : state . comment ,
554+ } ) ;
552555
553556export default connect ( mapStateToProps , {
554557 getAllCommentsOfPost,
555558 upVotePost,
556- rsvpYes
557- } ) ( withRouter ( NewsFeed ) )
559+ rsvpYes,
560+ } ) ( withRouter ( NewsFeed ) ) ;
0 commit comments