-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add comment form and use database for comments (#159)
* sk - Add section02.md * Sk - Add section02.md * Sk - More edits to section02.md * created comment form * Format * Change comments to reviews, edit review page, use database for reviews * Add WriteReviewPage test Co-authored-by: Christopher <51393127+chriscerie@users.noreply.github.com>
- Loading branch information
1 parent
5508512
commit 88e30d2
Showing
23 changed files
with
451 additions
and
182 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
21 changes: 0 additions & 21 deletions
21
client/src/pages/LocationPage/CommentSection/CommentForm.tsx
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 11 additions & 11 deletions
22
.../LocationPage/CommentSection/Comment.scss → ...es/LocationPage/ReviewSection/Review.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
import MoreHorizIcon from '@mui/icons-material/MoreHoriz'; | ||
import { IconButton } from '@mui/material'; | ||
import type { UserType } from '../../../types/UserType'; | ||
import './Review.scss'; | ||
|
||
export type ReviewType = { | ||
_id: string; | ||
author_id: string; | ||
body: string; | ||
liked_by: Array<string>; | ||
created_at: string; | ||
author?: UserType; | ||
}; | ||
|
||
const Review = ({ comm }: { comm: ReviewType }) => { | ||
console.log(comm); | ||
console.log(comm.author); | ||
return ( | ||
<li className="review-container"> | ||
<div className="review-header-container"> | ||
<div className="review-header-leftside"> | ||
<div className="review-header-leftside-body"> | ||
<div className="review-profile-image-container"> | ||
<img | ||
src={comm.author ? comm.author.profile_picture : ''} | ||
alt="profile" | ||
className="review-profile-image" | ||
/> | ||
</div> | ||
<div className="review-user-info-container"> | ||
<div className="review-user-info"> | ||
{comm.author ? comm.author.first_name : 'Unknown'} | ||
</div> | ||
<div>{comm.created_at}</div> | ||
</div> | ||
</div> | ||
</div> | ||
<div className="review-header-rightside"> | ||
<IconButton> | ||
<MoreHorizIcon /> | ||
</IconButton> | ||
</div> | ||
</div> | ||
<div className="review-text-container"> | ||
<p className="review-text">{comm.body}</p> | ||
</div> | ||
</li> | ||
); | ||
}; | ||
|
||
export default Review; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
.review-section-container { | ||
margin-top: 40px; | ||
padding: 0; | ||
margin: 0; | ||
} |
Oops, something went wrong.