d
This commit is contained in:
parent
2c3bfefa4c
commit
2a29a050a6
2 changed files with 10 additions and 4 deletions
|
@ -273,11 +273,13 @@ const StatusContent: React.FC<IStatusContent> = ({ status, expanded = false, onE
|
||||||
output.push(<ReadMoreButton onClick={onClick} key='read-more' />);
|
output.push(<ReadMoreButton onClick={onClick} key='read-more' />);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (status.poll && typeof status.poll === 'string') {
|
const hasPoll = status.poll && typeof status.poll === 'string';
|
||||||
|
|
||||||
|
if (hasPoll) {
|
||||||
output.push(<Poll id={status.poll} key='poll' status={status.url} />);
|
output.push(<Poll id={status.poll} key='poll' status={status.url} />);
|
||||||
}
|
}
|
||||||
|
|
||||||
return <>{output}</>;
|
return <div className={classNames({ 'bg-gray-100 rounded-md p-4': hasPoll })}>{output}</div>;
|
||||||
} else {
|
} else {
|
||||||
const output = [
|
const output = [
|
||||||
<div
|
<div
|
||||||
|
|
|
@ -140,7 +140,12 @@ const PollForm = (props: IPollForm) => {
|
||||||
const maxOptions = pollLimits.get('max_options');
|
const maxOptions = pollLimits.get('max_options');
|
||||||
const maxOptionChars = pollLimits.get('max_characters_per_option');
|
const maxOptionChars = pollLimits.get('max_characters_per_option');
|
||||||
|
|
||||||
const handleAddOption = () => onAddOption('');
|
const handleAddOption = () => {
|
||||||
|
// autofocus on new input
|
||||||
|
// use streamfield
|
||||||
|
onAddOption('');
|
||||||
|
};
|
||||||
|
|
||||||
const handleSelectDuration = (value: number) => onChangeSettings(value, isMultiple);
|
const handleSelectDuration = (value: number) => onChangeSettings(value, isMultiple);
|
||||||
const handleToggleMultiple = () => onChangeSettings(expiresIn, !isMultiple);
|
const handleToggleMultiple = () => onChangeSettings(expiresIn, !isMultiple);
|
||||||
|
|
||||||
|
@ -170,7 +175,6 @@ const PollForm = (props: IPollForm) => {
|
||||||
{options.size < maxOptions && (
|
{options.size < maxOptions && (
|
||||||
<Button
|
<Button
|
||||||
theme='secondary'
|
theme='secondary'
|
||||||
icon={require('@tabler/icons/icons/plus.svg')}
|
|
||||||
onClick={handleAddOption}
|
onClick={handleAddOption}
|
||||||
size='sm'
|
size='sm'
|
||||||
>
|
>
|
||||||
|
|
Loading…
Reference in a new issue