Skip to content

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

✨ Add feedback form (#1708)

Luke Vella27d4e1717cb9
diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.json
index 4d0dbf06a..2e711fc07 100644
--- a/apps/web/public/locales/en/app.json
+++ b/apps/web/public/locales/en/app.json
@@ -333,5 +333,10 @@
"errorNotAuthenticated": "Not authenticated",
"errorInvalidFields": "Invalid fields. Please check your input.",
"errorDatabaseUpdateFailed": "Database error: Failed to update settings.",
- "pending": "Pending"
+ "pending": "Pending",
+ "helpUsImprove": "Help us improve",
+ "helpUsImproveDesc": "Take a few minutes to share your feedback and help us shape the future of Rallly.",
+ "giveFeedback": "Give feedback",
+ "homeActionsTitle": "Actions",
+ "dismissFeedback": "Don't show again"
}
diff --git a/apps/web/src/app/[locale]/(space)/feedback-alert.tsx b/apps/web/src/app/[locale]/(space)/feedback-alert.tsx
new file mode 100644
index 000000000..82728bf46
--- /dev/null
+++ b/apps/web/src/app/[locale]/(space)/feedback-alert.tsx
@@ -0,0 +1,56 @@
+"use client";
+import { useLocalStorage } from "react-use";
+
+import { Trans } from "@/components/trans";
+import { usePostHog } from "@rallly/posthog/client";
+import { Button } from "@rallly/ui/button";
+import { HeartIcon } from "lucide-react";
+import Link from "next/link";
+
+export function FeedbackAlert() {
+ const [value, setValue] = useLocalStorage<string>("home_feedback_dismissed");
+ const posthog = usePostHog();
+
+ if (value) {
+ return null;
+ }
+
+ return (
+ <div className="flex flex-col sm:flex-row items-start border text-sm bg-gray-50 border-gray-200 p-4 rounded-xl gap-4">
+ <div className="hidden sm:block">
+ <HeartIcon className="size-4 text-pink-600 opacity-75" />
+ </div>
+ <div className="flex-1">
+ <h2 className="font-semibold leading-none">
+ <Trans i18nKey="helpUsImprove" defaults="Help us improve" />
+ </h2>
+ <p className="opacity-75 mt-1.5">
+ <Trans
+ i18nKey="helpUsImproveDesc"
+ defaults="Take a few minutes to share your feedback and help us shape the future of Rallly."
+ />
+ </p>
+ </div>
+ <div className="flex items-center flex-row-reverse sm:flex-row gap-2">
+ <Button
+ variant="ghost"
+ onClick={() => {
+ setValue("1");
+ posthog.capture("feedback_dismissed");
+ }}
+ >
+ <Trans i18nKey="dismissFeedback" defaults="Don't show again" />
+ </Button>
+ <Button variant="primary" asChild>
+ <Link
+ href="https://senja.io/p/rallly/r/uwwiXJ"
+ type="button"
+ id="feedback-survey-button"
+ >
+ <Trans i18nKey="giveFeedback" defaults="Give feedback" />
+ </Link>
+ </Button>
+ </div>
+ </div>
+ );
+}
diff --git a/apps/web/src/app/[locale]/(space)/page.tsx b/apps/web/src/app/[locale]/(space)/page.tsx
index b681ba24a..a431d50ad 100644
--- a/apps/web/src/app/[locale]/(space)/page.tsx
+++ b/apps/web/src/app/[locale]/(space)/page.tsx
@@ -4,6 +4,7 @@ import Link from "next/link";
import type { Params } from "@/app/[locale]/types";
import {
BillingPageIcon,
+ CreatePageIcon,
EventPageIcon,
HomePageIcon,
PollPageIcon,
@@ -18,7 +19,9 @@ import {
PageTitle,
} from "@/app/components/page-layout";
import { Trans } from "@/components/trans";
+import { IfCloudHosted } from "@/contexts/environment";
import { getTranslation } from "@/i18n/server";
+import { FeedbackAlert } from "./feedback-alert";
export default async function Page(props: { params: Promise<Params> }) {
const params = await props.params;
@@ -39,20 +42,24 @@ export default async function Page(props: { params: Promise<Params> }) {
</PageDescription>
</PageHeader>
<PageContent className="space-y-8">
- {/* <div className="space-y-4">
+ <div className="space-y-4">
<h2 className="text-muted-foreground text-sm">
<Trans i18nKey="homeActionsTitle" defaults="Actions" />
</h2>
<TileGrid>
- <Tile href="/new">
- <CreatePageIcon />
- <TileTitle>
- <Trans i18nKey="create" defaults="Create" />
- </TileTitle>
+ <Tile asChild>
+ <Link href="/new">
+ <CreatePageIcon />
+ <TileTitle>
+ <Trans i18nKey="create" defaults="Create" />
+ </TileTitle>
+ </Link>
</Tile>
</TileGrid>
- </div> */}
-
+ </div>
+ <IfCloudHosted>
+ <FeedbackAlert />
+ </IfCloudHosted>
<div className="space-y-4">
<h2 className="text-muted-foreground text-sm">
<Trans i18nKey="homeNavTitle" defaults="Navigation" />
@@ -75,16 +82,8 @@ export default async function Page(props: { params: Promise<Params> }) {
</TileTitle>
</Link>
</Tile>
-
- {/* <Tile href="/members">
- <MembersPageIcon />
- <TileTitle>
- <Trans i18nKey="members" defaults="Members" />
- </TileTitle>
- </Tile> */}
</TileGrid>
</div>
-
<div className="space-y-4">
<h2 className="text-muted-foreground text-sm">
<Trans i18nKey="account" defaults="Account" />