Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implemented Comments part 1 #34

Merged
merged 13 commits into from
Jan 3, 2024
Merged

Implemented Comments part 1 #34

merged 13 commits into from
Jan 3, 2024

Conversation

Pdzly
Copy link
Member

@Pdzly Pdzly commented Dec 29, 2023

Implemented Comments ( Upvotes, Downvotes )

Not implemented:

Replies
More options button

@Pdzly Pdzly added the enhancement New feature or request label Dec 29, 2023
@Pdzly Pdzly requested a review from kgilles December 29, 2023 21:53
@Pdzly Pdzly self-assigned this Dec 29, 2023
Copy link
Member

@kgilles kgilles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is great stuff! Appreciate the work you're putting into the project!

src/components/comment-votes/index.tsx Outdated Show resolved Hide resolved
}>;
size: typeof ICON_SIZE[keyof typeof ICON_SIZE];
title?: string;
titleId?: string;
className?: string;
SvgClassName?: string;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SvgClassName isn't needed. We can use className instead to change the styling of the SVG icon. By using text- classes rather than fill-. Like we're doing in PostVotes.

Copy link
Member Author

@Pdzly Pdzly Dec 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you notice that it doesnt work? Those are svg icons not font icons!

text- is good for font icons in our case its svg.

And i would keep it as so, when we want to change the div in the background.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This works just fine for me.

<Icon IconType={ArrowUpIcon} size={ICON_SIZE.SMALL} className={`hover:text-blue-400 ${myVote === 1 && 'text-blue-600'}`} />

And i would keep it as so, when we want to change the div in the background.

If we want to change the background color we'll just use a bg- class. It won't interfere with the SVG.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm then on firefox this doesnt work. ( or just on my side )

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep it does NOT work on firefox and its probably just a sideeffect of chromes svg implementation.

Because of this i would propose to stay what i done for firefox compatibility

src/components/linkbutton/index.tsx Outdated Show resolved Hide resolved
src/components/person-comments-posts/index.tsx Outdated Show resolved Hide resolved
src/components/text/index.tsx Outdated Show resolved Hide resolved
src/components/comment-header/index.tsx Outdated Show resolved Hide resolved
src/components/comment/index.tsx Outdated Show resolved Hide resolved
src/components/comment/index.tsx Outdated Show resolved Hide resolved
src/components/comment/index.tsx Show resolved Hide resolved
@@ -1,3 +1,5 @@
'use client';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rather than making the parent components of VoteButtons client-side, could we move the like/dislike logic into it? I don't think we would expect to do anything other than calling the likeComment API function when an arrow is clicked. All it would need to know is the entity ID and whether it's a post or a comment that's being voted on.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And likePost + in the future invalidate cache and refetch that post

src/components/button-votes/index.tsx Outdated Show resolved Hide resolved
@kgilles kgilles self-requested a review January 2, 2024 21:34
@kgilles kgilles self-requested a review January 3, 2024 17:16
@Pdzly Pdzly merged commit 796e650 into main Jan 3, 2024
3 checks passed
@Pdzly Pdzly deleted the feature/comments branch January 3, 2024 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants