diff --git a/ui/src/pages/Questions/Detail/components/Reactions/index.tsx b/ui/src/pages/Questions/Detail/components/Reactions/index.tsx index 8fa09509..6405de3b 100644 --- a/ui/src/pages/Questions/Detail/components/Reactions/index.tsx +++ b/ui/src/pages/Questions/Detail/components/Reactions/index.tsx @@ -26,6 +26,7 @@ import classNames from 'classnames'; import { Icon } from '@/components'; import { queryReactions, updateReaction } from '@/services'; import { tryNormalLogged } from '@/utils/guard'; +import { isDarkTheme } from '@/utils/common'; import { ReactionItem } from '@/common/interface'; interface Props { @@ -60,6 +61,7 @@ const Index: FC = ({ const [reactions, setReactions] = useState(); const [reactIsActive, setReactIsActive] = useState(false); const { t } = useTranslation('translation'); + const darkMode = isDarkTheme(); useEffect(() => { queryReactions(objectId).then((res) => { @@ -94,7 +96,7 @@ const Index: FC = ({ : t(`reaction.${d.name}`) } key={d.icon} - variant="light" + variant={darkMode ? 'dark' : 'light'} active={reactions?.find((v) => v.emoji === d.name)?.is_active} className={`${index !== 0 ? 'ms-1' : ''}`} size="sm" @@ -116,7 +118,7 @@ const Index: FC = ({ {showAddCommentBtn && ( @@ -165,7 +167,7 @@ const Index: FC = ({ : t('reaction.react_emoji', { emoji: data.emoji }) } aria-pressed="true" - variant="light" + variant={darkMode ? 'dark' : 'light'} active={data.is_active} size="sm" onClick={() => diff --git a/ui/src/pages/Questions/Detail/index.scss b/ui/src/pages/Questions/Detail/index.scss index 4b9eb622..8c7396ad 100644 --- a/ui/src/pages/Questions/Detail/index.scss +++ b/ui/src/pages/Questions/Detail/index.scss @@ -27,11 +27,17 @@ [data-bs-theme='dark'] & { background-color: var(--bs-gray-800); } + background-color: var(--bs-gray-100); } - &:active, &.active { + &:active, + &.active { background-color: var(--bs-gray-200); + + [data-bs-theme='dark'] & { + background-color: var(--bs-gray-800); + } } } } @@ -59,4 +65,4 @@ font-size: calc(1.275rem + 0.3vw) !important; } } -} +} \ No newline at end of file