Skip to content

Commit

Permalink
feat: select multiple feedback options in question
Browse files Browse the repository at this point in the history
  • Loading branch information
JoeSlain committed Dec 18, 2024
1 parent a56d763 commit 88d2d87
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/components/Feedbacks/ButtonsOptions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@ export function ButtonsOptions<T extends PositiveReason | NegativeReason>({
const handleClick = (reasonValue: T) => {
console.log('handleclick:', 'reasonValue:', reasonValue)
if (reasons.includes(reasonValue)) {
// Remove the reason if already selected
setReasons(reasons.filter((reason) => reason !== reasonValue))
} else {
// Set a single reason
setReasons([reasonValue])
setReasons([...reasons, reasonValue])
}
}

Expand Down Expand Up @@ -79,7 +77,3 @@ export function ButtonsOptions<T extends PositiveReason | NegativeReason>({
</div>
)
}

function isOtherReasonButton(reason: string) {
return reason.startsWith('tag-')
}

0 comments on commit 88d2d87

Please sign in to comment.