mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-02 10:41:54 +02:00
Allow adding multiple participants (#220)
This commit is contained in:
parent
a1d86dbb4b
commit
68ef2e3cec
2 changed files with 4 additions and 5 deletions
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue