-
Notifications
You must be signed in to change notification settings - Fork 5
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
Conversation
There was a problem hiding this 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/icon/index.tsx
Outdated
}>; | ||
size: typeof ICON_SIZE[keyof typeof ICON_SIZE]; | ||
title?: string; | ||
titleId?: string; | ||
className?: string; | ||
SvgClassName?: string; |
There was a problem hiding this comment.
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
.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 )
There was a problem hiding this comment.
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
@@ -1,3 +1,5 @@ | |||
'use client'; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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
Implemented Comments ( Upvotes, Downvotes )
Not implemented:
Replies
More options button