Allow adding multiple participants (#220)

This commit is contained in:
Luke Vella 2022-07-05 17:17:41 +01:00 committed by GitHub
parent a1d86dbb4b
commit 68ef2e3cec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 5 deletions

View file

@ -27,8 +27,7 @@ const minSidebarWidth = 200;
const Poll: React.VoidFunctionComponent = () => { const Poll: React.VoidFunctionComponent = () => {
const { t } = useTranslation("app"); const { t } = useTranslation("app");
const { poll, options, userAlreadyVoted, targetTimeZone, setTargetTimeZone } = const { poll, options, targetTimeZone, setTargetTimeZone } = usePoll();
usePoll();
const { participants } = useParticipants(); const { participants } = useParticipants();
@ -66,7 +65,7 @@ const Poll: React.VoidFunctionComponent = () => {
const maxScrollPosition = const maxScrollPosition =
columnWidth * options.length - columnWidth * numberOfVisibleColumns; columnWidth * options.length - columnWidth * numberOfVisibleColumns;
const shouldShowNewParticipantForm = !userAlreadyVoted && !poll.closed; const shouldShowNewParticipantForm = !poll.closed;
const pollWidth = const pollWidth =
sidebarWidth + options.length * columnWidth + actionColumnWidth; sidebarWidth + options.length * columnWidth + actionColumnWidth;

View file

@ -255,7 +255,7 @@ const MobilePoll: React.VoidFunctionComponent = () => {
}} }}
/> />
</div> </div>
) : !userAlreadyVoted ? ( ) : (
<Button <Button
type="primary" type="primary"
icon={<PlusCircle />} icon={<PlusCircle />}
@ -270,7 +270,7 @@ const MobilePoll: React.VoidFunctionComponent = () => {
> >
New New
</Button> </Button>
) : null} )}
</div> </div>
{timeZone ? ( {timeZone ? (
<TimeZonePicker <TimeZonePicker