Add demo poll notice (#482)

This commit is contained in:
Luke Vella 2023-02-06 15:26:50 +00:00 committed by GitHub
parent 5a4ce37d04
commit 1984dfc951
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 4 deletions

View file

@ -114,7 +114,7 @@ export const AdminControls = (props: { children?: React.ReactNode }) => {
height: 0,
marginBottom: 0,
}}
className="rounded-md border bg-white shadow-sm"
className="overflow-hidden rounded-md border bg-white shadow-sm"
>
<Sharing
className="p-4"

View file

@ -2,6 +2,7 @@ import { useTranslation } from "next-i18next";
import React from "react";
import Discussion from "@/components/discussion";
import Exclamation from "@/components/icons/exclamation.svg";
import LockClosed from "@/components/icons/lock-closed.svg";
import DesktopPoll from "@/components/poll/desktop-poll";
import MobilePoll from "@/components/poll/mobile-poll";
@ -47,10 +48,18 @@ export const Poll = (props: { children?: React.ReactNode }) => {
<div>
<div className="mx-auto max-w-full space-y-3 sm:space-y-4 lg:mx-0">
{props.children}
{poll.closed ? (
<div className="flex items-center gap-3 border border-pink-200 bg-pink-100 p-3 text-pink-600 md:mb-4 md:rounded-md md:shadow-sm">
{poll.demo ? (
<div className="flex items-start gap-3 rounded-md border border-amber-200 bg-amber-100 p-3 text-amber-600 shadow-sm">
<div className="rounded-md">
<LockClosed className="w-5" />
<Exclamation className="w-7" />
</div>
<div>{t("demoPollNotice")}</div>
</div>
) : null}
{poll.closed ? (
<div className="flex items-center gap-3 rounded-md border border-pink-200 bg-pink-100 p-3 text-pink-600 shadow-sm">
<div className="rounded-md">
<LockClosed className="w-7" />
</div>
<div>{t("pollHasBeenLocked")}</div>
</div>