mirror of
https://github.com/lukevella/rallly.git
synced 2025-06-23 21:07:10 +02:00
Prevent voting when poll is locked
This commit is contained in:
parent
46efb0fa48
commit
5f653ff593
1 changed files with 2 additions and 2 deletions
|
@ -72,7 +72,7 @@ const Poll: React.VoidFunctionComponent<PollProps> = ({ pollId }) => {
|
||||||
const [didUsePagination, setDidUsePagination] = React.useState(false);
|
const [didUsePagination, setDidUsePagination] = React.useState(false);
|
||||||
|
|
||||||
const [shouldShowNewParticipantForm, setShouldShowNewParticipantForm] =
|
const [shouldShowNewParticipantForm, setShouldShowNewParticipantForm] =
|
||||||
React.useState(!userAlreadyVoted);
|
React.useState(!userAlreadyVoted && !poll.closed);
|
||||||
|
|
||||||
const pollWidth =
|
const pollWidth =
|
||||||
sidebarWidth + options.length * columnWidth + actionColumnWidth;
|
sidebarWidth + options.length * columnWidth + actionColumnWidth;
|
||||||
|
@ -198,7 +198,7 @@ const Poll: React.VoidFunctionComponent<PollProps> = ({ pollId }) => {
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{shouldShowNewParticipantForm ? (
|
{shouldShowNewParticipantForm && !poll.closed ? (
|
||||||
<ParticipantRowForm
|
<ParticipantRowForm
|
||||||
className="border-t bg-slate-100 bg-opacity-0"
|
className="border-t bg-slate-100 bg-opacity-0"
|
||||||
onSubmit={(data) => {
|
onSubmit={(data) => {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue