2
0
This commit is contained in:
Baptiste Arnaud
2022-06-21 12:07:41 +02:00
5 changed files with 32 additions and 52 deletions

View File

@ -7,6 +7,7 @@ type Props = {
export const RatingInputContent = ({ block }: Props) => (
<Text noOfLines={1} pr="6">
Rate from 1 to {block.options.length}
Rate from {block.options.buttonType === 'Icons' ? 1 : 0} to{' '}
{block.options.length}
</Text>
)

View File

@ -33,9 +33,6 @@ export const RatingInputSettings = ({
const handleLeftLabelChange = (left: string) =>
onOptionsChange({ ...options, labels: { ...options.labels, left } })
const handleMiddleLabelChange = (middle: string) =>
onOptionsChange({ ...options, labels: { ...options.labels, middle } })
const handleRightLabelChange = (right: string) =>
onOptionsChange({ ...options, labels: { ...options.labels, right } })
@ -92,7 +89,7 @@ export const RatingInputSettings = ({
)}
<Stack>
<FormLabel mb="0" htmlFor="button">
1 label:
{options.buttonType === 'Icons' ? '1' : '0'} label:
</FormLabel>
<Input
id="button"
@ -101,19 +98,6 @@ export const RatingInputSettings = ({
placeholder="Not likely at all"
/>
</Stack>
{options.length >= 4 && (
<Stack>
<FormLabel mb="0" htmlFor="button">
{Math.floor(options.length / 2)} label:
</FormLabel>
<Input
id="button"
defaultValue={options.labels.middle}
onChange={handleMiddleLabelChange}
placeholder="Neutral"
/>
</Stack>
)}
<Stack>
<FormLabel mb="0" htmlFor="button">
{options.length} label: