mirror of
https://github.com/wassname/Open-Assistant.git
synced 2026-09-10 11:41:04 +08:00
Merge pull request #446 from chs20/fix/message-flag-dark-mode
Fix message flagging in dark mode (#434)
This commit is contained in:
@@ -17,12 +17,15 @@ import {
|
|||||||
Spacer,
|
Spacer,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
useBoolean,
|
useBoolean,
|
||||||
|
useColorMode,
|
||||||
|
useColorModeValue,
|
||||||
useId,
|
useId,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
import { FlagIcon, QuestionMarkCircleIcon } from "@heroicons/react/20/solid";
|
import { FlagIcon, QuestionMarkCircleIcon } from "@heroicons/react/20/solid";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import poster from "src/lib/poster";
|
import poster from "src/lib/poster";
|
||||||
import useSWRMutation from "swr/mutation";
|
import useSWRMutation from "swr/mutation";
|
||||||
|
import { colors } from "styles/Theme/colors";
|
||||||
|
|
||||||
export const FlaggableElement = (props) => {
|
export const FlaggableElement = (props) => {
|
||||||
const [isEditing, setIsEditing] = useBoolean();
|
const [isEditing, setIsEditing] = useBoolean();
|
||||||
@@ -102,7 +105,10 @@ export const FlaggableElement = (props) => {
|
|||||||
<Button
|
<Button
|
||||||
isDisabled={!checkboxValues.some(Boolean)}
|
isDisabled={!checkboxValues.some(Boolean)}
|
||||||
onClick={submitResponse}
|
onClick={submitResponse}
|
||||||
className="bg-indigo-600 text-black hover:bg-indigo-700"
|
className={`bg-indigo-600 text-${useColorModeValue(
|
||||||
|
colors.light.text,
|
||||||
|
colors.dark.text
|
||||||
|
)} hover:bg-indigo-700`}
|
||||||
>
|
>
|
||||||
Report
|
Report
|
||||||
</Button>
|
</Button>
|
||||||
@@ -133,6 +139,12 @@ function FlagCheckbox(props: {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const id = useId();
|
const id = useId();
|
||||||
|
const { colorMode } = useColorMode();
|
||||||
|
|
||||||
|
const labelTextClass =
|
||||||
|
colorMode === "light"
|
||||||
|
? `text-${colors.light.text} hover:text-blue-700 float-left`
|
||||||
|
: `text-${colors.dark.text} hover:text-blue-400 float-left`;
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Flex gap={1}>
|
<Flex gap={1}>
|
||||||
@@ -143,7 +155,7 @@ function FlagCheckbox(props: {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<label className="text-sm form-check-label" htmlFor={id}>
|
<label className="text-sm form-check-label" htmlFor={id}>
|
||||||
<span className="text-gray-800 hover:text-blue-700 float-left">{props.option.labelText}</span>
|
<span className={labelTextClass}>{props.option.labelText}</span>
|
||||||
{AdditionalExplanation}
|
{AdditionalExplanation}
|
||||||
</label>
|
</label>
|
||||||
<Spacer />
|
<Spacer />
|
||||||
|
|||||||
Reference in New Issue
Block a user