fixed and idk why
This commit is contained in:
parent
55c7a0e977
commit
9b24aaf349
|
@ -27,8 +27,8 @@ import { CHOICE_ANSWER_COLORS } from '../charts/contract/choice'
|
|||
import { useChartAnswers } from '../charts/contract/choice'
|
||||
import { ChatIcon } from '@heroicons/react/outline'
|
||||
|
||||
export function getAnswerColor(answer: Answer, answersArray: Answer[]) {
|
||||
const colorIndex = answersArray.indexOf(answer)
|
||||
export function getAnswerColor(answer: Answer, answersArray: string[]) {
|
||||
const colorIndex = answersArray.indexOf(answer.text)
|
||||
return colorIndex != undefined && colorIndex < CHOICE_ANSWER_COLORS.length
|
||||
? CHOICE_ANSWER_COLORS[colorIndex]
|
||||
: '#B1B1C7'
|
||||
|
@ -114,7 +114,7 @@ export function AnswersPanel(props: {
|
|||
? 'checkbox'
|
||||
: undefined
|
||||
|
||||
const answersArray = useChartAnswers(contract)
|
||||
const answersArray = useChartAnswers(contract).map((answer) => answer.text)
|
||||
|
||||
return (
|
||||
<Col className="gap-3">
|
||||
|
|
|
@ -82,7 +82,7 @@ export function AnswerCommentInput(props: {
|
|||
contract: Contract<AnyContractType>
|
||||
answerResponse: Answer
|
||||
onCancelAnswerResponse?: () => void
|
||||
answersArray: Answer[]
|
||||
answersArray: string[]
|
||||
}) {
|
||||
const { contract, answerResponse, onCancelAnswerResponse, answersArray } =
|
||||
props
|
||||
|
|
|
@ -47,7 +47,6 @@ export function CommentsAnswer(props: {
|
|||
|
||||
return (
|
||||
<Row>
|
||||
{/* TODO: known bug, doesn't grab color in time and it is gray */}
|
||||
<div
|
||||
className="w-2"
|
||||
style={{
|
||||
|
@ -89,7 +88,7 @@ export function FreeResponseComments(props: {
|
|||
commentsByParent,
|
||||
tips,
|
||||
} = props
|
||||
const answersArray = useChartAnswers(contract)
|
||||
const answersArray = useChartAnswers(contract).map((answer) => answer.text)
|
||||
return (
|
||||
<>
|
||||
{answerResponse && (
|
||||
|
|
Loading…
Reference in New Issue
Block a user