Skip to content

Commit e1e212d

Browse files
committed
fix edit button overlap issue on smaller screen
1 parent 0b52ba1 commit e1e212d

File tree

1 file changed

+14
-7
lines changed

1 file changed

+14
-7
lines changed

components/EditComment.tsx

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,23 @@ const EditComment = ({ comment, commentID, isReply, _id }: CommentProps) => {
4444
onChange={(e) => setLocalComment(e.currentTarget.value)}
4545
placeholder='Add a reply...'
4646
name="comment" id="comment"
47-
className='sm:mb-0 mb-[60px] placeholder-grayish-blue
47+
className='placeholder-grayish-blue
4848
resize-none border rounded-md w-full h-24 py-3 px-5 focus:border-moderate-blue focus:outline-none
4949
'
5050
/>
51-
<button
52-
className='bg-moderate-blue self-end text-white px-5 py-2 uppercase rounded-md font-medium hover:opacity-50
53-
sm:static absolute bottom-5 right-5'
54-
>
55-
{commenting ? 'Updating' : 'Update'}
56-
</button>
51+
<div className='self-end flex items-center bg-white sm:static absolute bottom-5 right-5'>
52+
<button aria-label='cancel edit'>
53+
<i
54+
onClick={() => setEditCommentValues({ ...editCommentValues, editComment: false })}
55+
className='fas fa-times mr-5 text-xl'
56+
/>
57+
</button>
58+
<button
59+
className='bg-moderate-blue text-white px-5 py-2 uppercase rounded-md font-medium hover:opacity-50'
60+
>
61+
{commenting ? 'Updating' : 'Update'}
62+
</button>
63+
</div>
5764
</form>
5865
)
5966
}

0 commit comments

Comments
 (0)