Refactor admin and participant page (#464)

This commit is contained in:
Luke Vella 2023-02-01 10:50:05 +00:00 committed by GitHub
parent 875e48f1fe
commit d397654de7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
20 changed files with 348 additions and 236 deletions

View file

@ -28,7 +28,7 @@ const Discussion: React.VoidFunctionComponent = () => {
const { dayjs } = useDayjs();
const queryClient = trpc.useContext();
const { t } = useTranslation("app");
const { poll } = usePoll();
const { poll, admin } = usePoll();
const pollId = poll.id;
@ -93,7 +93,7 @@ const Discussion: React.VoidFunctionComponent = () => {
<AnimatePresence initial={false}>
{comments.map((comment) => {
const canDelete =
poll.admin || session.ownsObject(comment) || isUnclaimed(comment);
admin || session.ownsObject(comment) || isUnclaimed(comment);
return (
<motion.div