From b0ce108d23d16f83053aac9e576c2a0bfc4986ce Mon Sep 17 00:00:00 2001 From: William Killerud Date: Wed, 3 Nov 2021 16:19:09 +0100 Subject: [PATCH] chore: oppdater bruken av radioknapper affects: @fremtind/jkl-feedback-react BREAKING CHANGE: Avhenger av jkl-radio-button med breaking change --- .../src/questions/RadioQuestion.tsx | 23 ++++++++++++------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/packages/feedback-react/src/questions/RadioQuestion.tsx b/packages/feedback-react/src/questions/RadioQuestion.tsx index 728b2f600b4..049f520821d 100644 --- a/packages/feedback-react/src/questions/RadioQuestion.tsx +++ b/packages/feedback-react/src/questions/RadioQuestion.tsx @@ -1,5 +1,5 @@ import React, { ChangeEventHandler, useEffect, useMemo, useRef } from "react"; -import { RadioButtons } from "@fremtind/jkl-radio-button-react"; +import { RadioButton, RadioButtonGroup } from "@fremtind/jkl-radio-button-react"; import { QuestionProps } from "../types"; import { useFollowUpContext } from "../followup/followupContext"; import { useMainQuestionContext } from "../main-question/mainQuestionContext"; @@ -37,16 +37,23 @@ export const RadioQuestion: React.VFC = ({ label, name, options, } return ( - ({ label, value: value.toString() })) || []} - selectedValue={selectedValue} + inline={numOptions < 3} + value={selectedValue || ""} onChange={handleChange} helpLabel={helpLabel} - /> + > + {options?.map((option, i) => ( + + ))} + ); };