Skip to content

Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.

💄 Use an Alert for the comments phase out hint (#2882)

Luke Vella5e69b9d840f3
diff --git a/apps/web/src/features/poll/components/forms/poll-settings.test.tsx b/apps/web/src/features/poll/components/forms/poll-settings.test.tsx
index 703df088a..e1801e60b 100644
--- a/apps/web/src/features/poll/components/forms/poll-settings.test.tsx
+++ b/apps/web/src/features/poll/components/forms/poll-settings.test.tsx
@@ -60,4 +60,11 @@ describe("PollSettingsForm comments setting", () => {
screen.getByText(/comments are being phased out/i),
).toBeInTheDocument();
});
+
+ it("renders the phase out hint as an alert", () => {
+ render(<TestForm enableComments={true} />);
+ expect(screen.getByRole("alert")).toHaveTextContent(
+ /comments are being phased out/i,
+ );
+ });
});
diff --git a/apps/web/src/features/poll/components/forms/poll-settings.tsx b/apps/web/src/features/poll/components/forms/poll-settings.tsx
index a5bae5a08..faf116b62 100644
--- a/apps/web/src/features/poll/components/forms/poll-settings.tsx
+++ b/apps/web/src/features/poll/components/forms/poll-settings.tsx
@@ -1,6 +1,7 @@
"use client";
import { posthog } from "@rallly/posthog/client";
+import { Alert, AlertDescription } from "@rallly/ui/alert";
import { Badge } from "@rallly/ui/badge";
import { Card, CardContent, CardTitle } from "@rallly/ui/card";
import {
@@ -166,7 +167,7 @@ export const PollSettingsForm = ({ children }: React.PropsWithChildren) => {
control={form.control}
name="enableComments"
render={({ field }) => (
- <Field>
+ <div className="flex flex-col gap-3">
<Field orientation="horizontal">
<div className="@md/field-group:block hidden">
<PageIcon size="lg">
@@ -205,17 +206,17 @@ export const PollSettingsForm = ({ children }: React.PropsWithChildren) => {
/>
</Field>
{field.value ? (
- <FieldDescription className="flex items-start gap-x-1.5">
- <InfoIcon className="size-3.5 shrink-0 translate-y-px" />
- <span>
+ <Alert variant="info">
+ <InfoIcon />
+ <AlertDescription>
<Trans
i18nKey="commentsSettingPhaseOutHint"
defaults="Comments are being phased out. Participants can include a note with their response instead."
/>
- </span>
- </FieldDescription>
+ </AlertDescription>
+ </Alert>
) : null}
- </Field>
+ </div>
)}
/>
</FieldGroup>