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

fix thumbs up and thumbs down icons are not updating #280

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 12 additions & 12 deletions src/content-script/ChatGPTFeedback.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ThumbsdownIcon, ThumbsupIcon, CopyIcon, CheckIcon } from '@primer/octicons-react'
import { memo, useCallback, useState } from 'react'
import { CheckIcon, CopyIcon, ThumbsdownIcon, ThumbsupIcon } from '@primer/octicons-react'
import { useEffect } from 'preact/hooks'
import { memo, useCallback, useState } from 'react'
import Browser from 'webextension-polyfill'

interface Props {
Expand Down Expand Up @@ -61,17 +61,17 @@ function ChatGPTFeedback(props: Props) {

return (
<div className="gpt-feedback">
<span
onClick={clickThumbsUp}
className={action === 'thumbsUp' ? 'gpt-feedback-selected' : undefined}
>
<ThumbsupIcon size={14} />
<span onClick={clickThumbsUp}>
<ThumbsupIcon
size={14}
className={action === 'thumbsUp' ? 'gpt-feedback-selected' : undefined}
/>
</span>
<span
onClick={clickThumbsDown}
className={action === 'thumbsDown' ? 'gpt-feedback-selected' : undefined}
>
<ThumbsdownIcon size={14} />
<span onClick={clickThumbsDown}>
<ThumbsdownIcon
size={14}
className={action === 'thumbsDown' ? 'gpt-feedback-selected' : undefined}
/>
</span>
<span onClick={clickCopyToClipboard}>
{copied ? <CheckIcon size={14} /> : <CopyIcon size={14} />}
Expand Down