File tree Expand file tree Collapse file tree 4 files changed +28
-10
lines changed
components/processing/analysis/responseForms Expand file tree Collapse file tree 4 files changed +28
-10
lines changed Original file line number Diff line number Diff line change 1+ import { Radio , Stack } from '@mantine/core'
12import React , { useContext , useState } from 'react'
2- import Radio from '#/components/common/radio'
33import type { RadioOption } from '#/components/common/radio'
44import AnalysisQuestionsContext from '#/components/processing/analysis/analysisQuestions.context'
55import {
@@ -71,15 +71,19 @@ export default function SelectOneResponseForm(props: SelectOneResponseFormProps)
7171 }
7272
7373 return (
74- < ResponseWrapper uuid = { props . uuid } onClear = { ( ) => onRadioChange ( '' ) } >
75- < Radio
76- options = { getOptions ( ) }
77- name = { question . labels . _default }
78- onChange = { onRadioChange }
79- selected = { response }
80- isClearable
81- isDisabled = { ! props . canEdit }
82- />
74+ < ResponseWrapper uuid = { props . uuid } onClear = { ( ) => setResponse ( '' ) } >
75+ < Radio . Group >
76+ < Stack gap = { 'xs' } >
77+ { getOptions ( ) . map ( ( option ) => (
78+ < Radio
79+ value = { option . value }
80+ label = { option . label }
81+ onChange = { ( newResponse ) => onRadioChange ( newResponse . currentTarget . value ) }
82+ checked = { response === option . value }
83+ />
84+ ) ) }
85+ </ Stack >
86+ </ Radio . Group >
8387 </ ResponseWrapper >
8488 )
8589}
Original file line number Diff line number Diff line change 1+ .label {
2+ background-color : red;
3+ }
4+ .radio {
5+ cursor : pointer;
6+ }
Original file line number Diff line number Diff line change 1+ import { Radio } from '@mantine/core'
2+ import classes from './Radio.module.css'
3+
4+ export const RadioThemeKobo = Radio . extend ( {
5+ classNames : classes ,
6+ } )
Original file line number Diff line number Diff line change @@ -13,6 +13,7 @@ import { TableThemeKobo } from './Table'
1313import { TagsInputThemeKobo } from './TagsInput'
1414import { ThemeIconThemeKobo } from './ThemeIcon'
1515import { TooltipThemeKobo } from './Tooltip'
16+ import { RadioThemeKobo } from './Radio'
1617
1718export const themeKobo = createTheme ( {
1819 primaryColor : 'blue' ,
@@ -123,5 +124,6 @@ export const themeKobo = createTheme({
123124 TagsInput : TagsInputThemeKobo ,
124125 ThemeIcon : ThemeIconThemeKobo ,
125126 NumberInput : NumberInputThemeKobo ,
127+ Radio : RadioThemeKobo ,
126128 } ,
127129} )
You can’t perform that action at this time.
0 commit comments