Skip to content

Commit

Permalink
bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
alexandyrzph committed Aug 5, 2022
1 parent 823991f commit 1e87cca
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 25 deletions.
2 changes: 1 addition & 1 deletion pixelplace/src/components/Comment/Comment.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const Comment = ({ photoURL, displayName, comment, commentId, uid, currentUserId
<p className="w-full font-bold">@{displayName}</p>
<p className="w-full">{comment}</p>
</div>
{currentUserId === uid ? (
{currentUserId && currentUserId === uid ? (
<HiX
cursor={"pointer"}
onClick={deleteCommentHandler}
Expand Down
50 changes: 26 additions & 24 deletions pixelplace/src/components/Posts/PostDetails/PostDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,37 +147,39 @@ const PostDetails = () => {
{...comment}
key={uuidv4()}
postId={postId}
currentUserId={user.uid}
currentUserId={user?.uid}
/>
))
)}
</div>
</div>
<div className="flex flex-wrap mt-6 items-center gap-3">
<form
onSubmit={handleSubmit}
className="flex flex-wrap w-full items-center gap-2"
>
<img
src={user.photoURL}
className="w-9 h-9 items-center object-cover object-center rounded-full"
alt="user-profile"
/>
<input
className="flex-1 bg-gray-100 border-neu-white outline-none border-2 p-2 rounded-md focus:border-gray-500"
type="text"
placeholder="Add a comment"
value={comment}
onChange={(e) => setComment(e.target.value)}
/>
<button
type="button"
className="bg-neu-yellow text-neu-black border-2 border-neu-black hover:shadow-[2px_2px_2px] duration-75 rounded-md px-6 py-2 font-semibold text-base outline-none"
onClick={handleSubmit}
{user && (
<form
onSubmit={handleSubmit}
className="flex flex-wrap w-full items-center gap-2"
>
Send
</button>
</form>
<img
src={user.photoURL}
className="w-9 h-9 items-center object-cover object-center rounded-full"
alt="user-profile"
/>
<input
className="flex-1 bg-gray-100 border-neu-white outline-none border-2 p-2 rounded-md focus:border-gray-500"
type="text"
placeholder="Add a comment"
value={comment}
onChange={(e) => setComment(e.target.value)}
/>
<button
type="button"
className="bg-neu-yellow text-neu-black border-2 border-neu-black hover:shadow-[2px_2px_2px] duration-75 rounded-md px-6 py-2 font-semibold text-base outline-none"
onClick={handleSubmit}
>
Send
</button>
</form>
)}
</div>
<img
className="hidden lg:block absolute bottom-5 -right-20 opacity-10 -z-10 w-[200px]"
Expand Down

0 comments on commit 1e87cca

Please sign in to comment.