Adds the ability for users to update & delete comments #3453

Merged
osilkin98 merged 2 commits from comment-options into master 2020-01-31 22:30:52 +01:00
osilkin98 commented 2020-01-07 06:49:45 +01:00 (Migrated from github.com)

Adds the ability for users to update & delete their comments.

Changes:

  • Two new SVG icon are introduced of three circles aligned horizontally and vertically.
  • A new modal is created for the user to confirm before deleting a comment
  • Overall overhaul for the Comment component

This PR depends on #259 for redux to work properly.

Adds the ability for users to update & delete their comments. ### Changes: - Two new SVG icon are introduced of three circles aligned horizontally and vertically. - A new modal is created for the user to confirm before deleting a comment - Overall overhaul for the `Comment` component This PR depends on [#259](https://github.com/lbryio/lbry-redux/pull/259) for redux to work properly.
neb-b (Migrated from github.com) reviewed 2020-01-07 06:49:45 +01:00
neb-b (Migrated from github.com) requested changes 2020-01-23 22:08:27 +01:00
neb-b (Migrated from github.com) left a comment

mostly small stuff, this is pretty close.

I also saw an error when I tried to edit a comment. The snackbar was displayed and it said:

there was an error hiding this comment
mostly small stuff, this is pretty close. I also saw an error when I tried to edit a comment. The snackbar was displayed and it said: ``` there was an error hiding this comment ```
neb-b (Migrated from github.com) commented 2020-01-23 21:58:36 +01:00

This should not be removed

This should not be removed
@ -28,46 +38,144 @@ function Comment(props: Props) {
timePosted,
message,
neb-b (Migrated from github.com) commented 2020-01-23 22:05:12 +01:00

You are already wrapping this in commentIsMine so these aren't needed

You are already wrapping this in `commentIsMine` so these aren't needed
neb-b (Migrated from github.com) commented 2020-01-23 22:06:07 +01:00

set a classname based on if it's hovering, then we can use css variables. Currently in dark mode, the dots get darker when you hover.

set a classname based on if it's hovering, then we can use css variables. Currently in dark mode, the dots get darker when you hover.
neb-b (Migrated from github.com) commented 2020-01-23 22:06:34 +01:00

The space in between { and commentIsMine is because you disabled the precommit hook which formats the code.

The space in between `{` and `commentIsMine` is because you disabled the precommit hook which formats the code.
neb-b (Migrated from github.com) commented 2020-01-23 22:07:06 +01:00

these ^ comments aren't needed

these ^ comments aren't needed
@ -69,0 +148,4 @@
</MenuItem>
<MenuItem className="comment__menu-option" onSelect={handleDeleteComment}>
{__('Delete')}
</MenuItem>
neb-b (Migrated from github.com) commented 2020-01-23 22:02:45 +01:00

This can just delete the comment, we don't need a modal for it.

This can just delete the comment, we don't need a modal for it.
@ -13,0 +15,4 @@
// todo: implement comment_list --mine in SDK so redux can grab with selectCommentIsMine
const isMyComment = (channelId: string) => {
if (myChannels != null && channelId != null) {
neb-b (Migrated from github.com) commented 2020-01-23 22:04:30 +01:00

This was causing an error when I refreshed on a page with comments

"Cannot read property 'length' of undefined
    at isMyComment"
This was causing an error when I refreshed on a page with comments ``` "Cannot read property 'length' of undefined at isMyComment" ```
@ -81,6 +81,7 @@ export const SIGN_IN = 'SignIn';
export const TRENDING = 'Trending';
neb-b (Migrated from github.com) commented 2020-01-23 22:03:50 +01:00

remove this one since we aren't using it

remove this one since we aren't using it
neb-b (Migrated from github.com) commented 2020-01-23 22:03:28 +01:00

lets get rid of this modal

lets get rid of this modal
osilkin98 (Migrated from github.com) reviewed 2020-01-25 21:01:16 +01:00
osilkin98 (Migrated from github.com) commented 2020-01-25 21:01:15 +01:00

That must've snuck into the commit somehow, will revert.

That must've snuck into the commit somehow, will revert.
osilkin98 (Migrated from github.com) reviewed 2020-01-25 22:11:04 +01:00
@ -13,0 +15,4 @@
// todo: implement comment_list --mine in SDK so redux can grab with selectCommentIsMine
const isMyComment = (channelId: string) => {
if (myChannels != null && channelId != null) {
osilkin98 (Migrated from github.com) commented 2020-01-25 22:11:04 +01:00

Was using myChannels !== null instead of myChannels != null

Was using `myChannels !== null` instead of `myChannels != null`
osilkin98 (Migrated from github.com) reviewed 2020-01-25 23:30:51 +01:00
@ -28,46 +38,144 @@ function Comment(props: Props) {
timePosted,
message,
osilkin98 (Migrated from github.com) commented 2020-01-25 23:30:51 +01:00

done

done
neb-b commented 2020-01-27 16:41:55 +01:00 (Migrated from github.com)

@osilkin98 I still see "error hiding comment" when I edit a comment. It looks like the edit works correctly, but I see the error message every time.

@osilkin98 I still see "error hiding comment" when I edit a comment. It looks like the edit works correctly, but I see the error message every time.
osilkin98 commented 2020-01-28 22:22:13 +01:00 (Migrated from github.com)

@seanyesmunt Was this in the web version or the desktop?

@seanyesmunt Was this in the web version or the desktop?
osilkin98 commented 2020-01-28 23:22:16 +01:00 (Migrated from github.com)

@seanyesmunt In regards to the toast message, PR #265 should display the correct message in the snackbar.

In regards to displaying the comments as being updated but getting an error, the #265 also fixes that.

@seanyesmunt In regards to the toast message, [PR #265](https://github.com/lbryio/lbry-redux/pull/265) should display the correct message in the snackbar. In regards to displaying the comments as being updated but getting an error, the [#265](https://github.com/lbryio/lbry-redux/pull/265/commits) also fixes that.
osilkin98 commented 2020-01-28 23:37:53 +01:00 (Migrated from github.com)

Everything works perfectly fine now, should be safe to merge.

Everything works perfectly fine now, should be safe to merge.
neb-b commented 2020-01-29 20:33:29 +01:00 (Migrated from github.com)

@osilkin98 Please squash your commits and rebase, then it's good to merge.

@osilkin98 Please squash your commits and rebase, then it's good to merge.
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbry-desktop#3453
No description provided.