fix(polls) Update limits (#11748)
This commit is contained in:
parent
d5146aaf2e
commit
7b538fc3e9
|
@ -7,7 +7,7 @@ import { Button } from 'react-native-paper';
|
|||
import { Icon, IconClose } from '../../../base/icons';
|
||||
import BaseTheme from '../../../base/ui/components/BaseTheme.native';
|
||||
import { BUTTON_MODES } from '../../../chat/constants';
|
||||
import { CHAR_LIMIT } from '../../constants';
|
||||
import { ANSWERS_LIMIT, CHAR_LIMIT } from '../../constants';
|
||||
import AbstractPollCreate from '../AbstractPollCreate';
|
||||
import type { AbstractProps } from '../AbstractPollCreate';
|
||||
|
||||
|
@ -151,6 +151,7 @@ const PollCreate = (props: AbstractProps) => {
|
|||
<View style = { chatStyles.pollCreateButtonsContainer }>
|
||||
<Button
|
||||
color = { BaseTheme.palette.action02 }
|
||||
disabled = { answers.length >= ANSWERS_LIMIT }
|
||||
mode = { BUTTON_MODES.CONTAINED }
|
||||
onPress = { () => {
|
||||
// adding and answer
|
||||
|
|
|
@ -4,7 +4,7 @@ import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|||
|
||||
import { Icon, IconMenu } from '../../../base/icons';
|
||||
import { Tooltip } from '../../../base/tooltip';
|
||||
import { CHAR_LIMIT } from '../../constants';
|
||||
import { ANSWERS_LIMIT, CHAR_LIMIT } from '../../constants';
|
||||
import AbstractPollCreate from '../AbstractPollCreate';
|
||||
import type { AbstractProps } from '../AbstractPollCreate';
|
||||
|
||||
|
@ -237,6 +237,7 @@ const PollCreate = (props: AbstractProps) => {
|
|||
<button
|
||||
aria-label = { 'Add option' }
|
||||
className = 'poll-button poll-button-secondary'
|
||||
disabled = { answers.length >= ANSWERS_LIMIT }
|
||||
onClick = { () => {
|
||||
addAnswer();
|
||||
requestFocus(answers.length);
|
||||
|
|
|
@ -4,4 +4,5 @@ export const COMMAND_NEW_POLL = 'new-poll';
|
|||
export const COMMAND_ANSWER_POLL = 'answer-poll';
|
||||
export const COMMAND_OLD_POLLS = 'old-polls';
|
||||
|
||||
export const CHAR_LIMIT = 1000;
|
||||
export const CHAR_LIMIT = 500;
|
||||
export const ANSWERS_LIMIT = 255;
|
||||
|
|
Loading…
Reference in New Issue