Remove Row and run prettier
This commit is contained in:
parent
cfd6af7c72
commit
a42a0f086c
|
@ -1,4 +1,3 @@
|
||||||
import { Row } from './layout/row'
|
|
||||||
import { RadioGroup } from '@headlessui/react'
|
import { RadioGroup } from '@headlessui/react'
|
||||||
import clsx from 'clsx'
|
import clsx from 'clsx'
|
||||||
import React from 'react'
|
import React from 'react'
|
||||||
|
@ -20,31 +19,33 @@ export function ChoicesToggleGroup(props: {
|
||||||
children,
|
children,
|
||||||
} = props
|
} = props
|
||||||
return (
|
return (
|
||||||
<RadioGroup value={currentChoice.toString()} onChange={(str) => null}>
|
<RadioGroup
|
||||||
<Row className={'items-center flex-wrap gap-3'}>
|
className={clsx(className, 'flex flex-row flex-wrap items-center gap-3')}
|
||||||
{Object.keys(choicesMap).map((choiceKey) => (
|
value={currentChoice.toString()}
|
||||||
<RadioGroup.Option
|
onChange={(str) => null}
|
||||||
key={choiceKey}
|
>
|
||||||
value={choicesMap[choiceKey]}
|
{Object.keys(choicesMap).map((choiceKey) => (
|
||||||
onClick={() => setChoice(choicesMap[choiceKey])}
|
<RadioGroup.Option
|
||||||
className={({ active }) =>
|
key={choiceKey}
|
||||||
clsx(
|
value={choicesMap[choiceKey]}
|
||||||
active ? 'ring-2 ring-indigo-500 ring-offset-2' : '',
|
onClick={() => setChoice(choicesMap[choiceKey])}
|
||||||
currentChoice === choicesMap[choiceKey]
|
className={({ active }) =>
|
||||||
? 'border-transparent bg-indigo-500 text-white hover:bg-indigo-600'
|
clsx(
|
||||||
: 'border-gray-200 bg-white text-gray-900 hover:bg-gray-50',
|
active ? 'ring-2 ring-indigo-500 ring-offset-2' : '',
|
||||||
'flex cursor-pointer items-center justify-center rounded-md border py-3 px-3 text-sm font-medium normal-case',
|
currentChoice === choicesMap[choiceKey]
|
||||||
"hover:ring-offset-2' hover:ring-2 hover:ring-indigo-500",
|
? 'border-transparent bg-indigo-500 text-white hover:bg-indigo-600'
|
||||||
className
|
: 'border-gray-200 bg-white text-gray-900 hover:bg-gray-50',
|
||||||
)
|
'flex cursor-pointer items-center justify-center rounded-md border py-3 px-3 text-sm font-medium normal-case',
|
||||||
}
|
"hover:ring-offset-2' hover:ring-2 hover:ring-indigo-500",
|
||||||
disabled={isSubmitting}
|
className
|
||||||
>
|
)
|
||||||
<RadioGroup.Label as="span">{choiceKey}</RadioGroup.Label>
|
}
|
||||||
</RadioGroup.Option>
|
disabled={isSubmitting}
|
||||||
))}
|
>
|
||||||
{children}
|
<RadioGroup.Label as="span">{choiceKey}</RadioGroup.Label>
|
||||||
</Row>
|
</RadioGroup.Option>
|
||||||
|
))}
|
||||||
|
{children}
|
||||||
</RadioGroup>
|
</RadioGroup>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user