kopia lustrzana https://gitlab.com/soapbox-pub/soapbox
allow for creating and viewing single-option polls
rodzic
c568f2dc3c
commit
047947b155
|
@ -61,7 +61,7 @@ const Option: React.FC<IOption> = ({
|
||||||
const handleOptionTitleChange = (event: React.ChangeEvent<HTMLInputElement>) => onChange(index, event.target.value);
|
const handleOptionTitleChange = (event: React.ChangeEvent<HTMLInputElement>) => onChange(index, event.target.value);
|
||||||
|
|
||||||
const handleOptionRemove = () => {
|
const handleOptionRemove = () => {
|
||||||
if (numOptions > 2) {
|
if (numOptions > 1) {
|
||||||
onRemove(index);
|
onRemove(index);
|
||||||
} else {
|
} else {
|
||||||
onRemovePoll();
|
onRemovePoll();
|
||||||
|
@ -100,7 +100,7 @@ const Option: React.FC<IOption> = ({
|
||||||
/>
|
/>
|
||||||
</HStack>
|
</HStack>
|
||||||
|
|
||||||
{index > 1 && (
|
{index > 0 && (
|
||||||
<div>
|
<div>
|
||||||
<Button theme='danger' size='sm' onClick={handleOptionRemove}>
|
<Button theme='danger' size='sm' onClick={handleOptionRemove}>
|
||||||
<FormattedMessage id='compose_form.poll.remove_option' defaultMessage='Remove this answer' />
|
<FormattedMessage id='compose_form.poll.remove_option' defaultMessage='Remove this answer' />
|
||||||
|
|
Ładowanie…
Reference in New Issue