mirror of
https://github.com/lukevella/rallly.git
synced 2025-08-06 01:48:32 +02:00
🐛 Fix admin cannot see participants in mobile view when hidden
This commit is contained in:
parent
82f6d81e9b
commit
1d138cb2ab
1 changed files with 4 additions and 2 deletions
|
@ -11,6 +11,7 @@ import { useTranslation } from "@/app/i18n/client";
|
||||||
import { useParticipants } from "@/components/participants-provider";
|
import { useParticipants } from "@/components/participants-provider";
|
||||||
import { UserAvatar } from "@/components/user";
|
import { UserAvatar } from "@/components/user";
|
||||||
import { usePoll } from "@/contexts/poll";
|
import { usePoll } from "@/contexts/poll";
|
||||||
|
import { useRole } from "@/contexts/role";
|
||||||
|
|
||||||
import { ConnectedScoreSummary } from "../score-summary";
|
import { ConnectedScoreSummary } from "../score-summary";
|
||||||
import VoteIcon from "../vote-icon";
|
import VoteIcon from "../vote-icon";
|
||||||
|
@ -105,6 +106,7 @@ const PollOption: React.FunctionComponent<PollOptionProps> = ({
|
||||||
}) => {
|
}) => {
|
||||||
const poll = usePoll();
|
const poll = usePoll();
|
||||||
const showVotes = !!(selectedParticipantId || editable);
|
const showVotes = !!(selectedParticipantId || editable);
|
||||||
|
const role = useRole();
|
||||||
const selectorRef = React.useRef<HTMLButtonElement>(null);
|
const selectorRef = React.useRef<HTMLButtonElement>(null);
|
||||||
const [active, setActive] = React.useState(false);
|
const [active, setActive] = React.useState(false);
|
||||||
const [isExpanded, toggle] = useToggle(false);
|
const [isExpanded, toggle] = useToggle(false);
|
||||||
|
@ -123,8 +125,8 @@ const PollOption: React.FunctionComponent<PollOptionProps> = ({
|
||||||
>
|
>
|
||||||
<div className="flex h-7 items-center justify-between gap-x-4">
|
<div className="flex h-7 items-center justify-between gap-x-4">
|
||||||
<div className="shrink-0">{children}</div>
|
<div className="shrink-0">{children}</div>
|
||||||
<div className="flex items-center gap-x-2.5">
|
<div className="flex items-center gap-x-4">
|
||||||
{poll.hideParticipants ? (
|
{role === "participant" && poll.hideParticipants ? (
|
||||||
<ConnectedScoreSummary optionId={optionId} />
|
<ConnectedScoreSummary optionId={optionId} />
|
||||||
) : (
|
) : (
|
||||||
<Button
|
<Button
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue