From d08ed6d0f7dbafe093c4e85fe01a50c8b82568a4 Mon Sep 17 00:00:00 2001 From: Luke Vella Date: Wed, 2 Aug 2023 18:30:10 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=93=93=20Add=20changelog=20widget=20(#798?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 5 +- apps/landing/declarations/environment.d.ts | 4 - apps/web/declarations/environment.d.ts | 4 +- apps/web/public/locales/en/app.json | 4 +- apps/web/src/components/featurebase.tsx | 68 +++++++++++-- apps/web/src/components/feedback.tsx | 97 +++++++++---------- .../forms/poll-options-form/week-calendar.tsx | 2 - .../components/layouts/standard-layout.tsx | 39 +++++--- apps/web/src/components/user-dropdown.tsx | 25 ++--- apps/web/src/style.css | 1 + apps/web/src/utils/constants.ts | 3 + packages/tsconfig/environment.d.ts | 2 +- packages/ui/button.tsx | 2 +- turbo.json | 2 +- 14 files changed, 158 insertions(+), 100 deletions(-) diff --git a/.gitignore b/.gitignore index 4f9cb66c8..a1c458b17 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,7 @@ yarn-error.log* tsconfig.tsbuildinfo # Turbo -.turbo \ No newline at end of file +.turbo + +# Jetbrains IDE +.idea \ No newline at end of file diff --git a/apps/landing/declarations/environment.d.ts b/apps/landing/declarations/environment.d.ts index a16d7de81..9a8ee49de 100644 --- a/apps/landing/declarations/environment.d.ts +++ b/apps/landing/declarations/environment.d.ts @@ -33,10 +33,6 @@ declare global { * Crisp website ID */ NEXT_PUBLIC_CRISP_WEBSITE_ID?: string; - /** - * When defined users will be able to send feedback to this email address - */ - NEXT_PUBLIC_FEEDBACK_EMAIL?: string; /** * Users of your instance will see this as their support email */ diff --git a/apps/web/declarations/environment.d.ts b/apps/web/declarations/environment.d.ts index f6efc9044..770ce9be5 100644 --- a/apps/web/declarations/environment.d.ts +++ b/apps/web/declarations/environment.d.ts @@ -34,9 +34,9 @@ declare global { */ NEXT_PUBLIC_CRISP_WEBSITE_ID?: string; /** - * When defined users will be able to send feedback to this email address + * When `true` it will show the feedback button and pull the changelog from featurebase */ - NEXT_PUBLIC_FEEDBACK_EMAIL?: string; + NEXT_PUBLIC_FEEDBACK_ENABLED?: string; /** * Users of your instance will see this as their support email */ diff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.json index 46269b3bd..ad53f6f5b 100644 --- a/apps/web/public/locales/en/app.json +++ b/apps/web/public/locales/en/app.json @@ -121,7 +121,6 @@ "inviteLink": "Invite Link", "inviteParticipantLinkInfo": "Anyone with this link will be able to vote on your poll.", "support": "Support", - "changelog": "Change log", "billing": "Billing", "guestPollAlertDescription": "<0>Create an account or <1>login to claim this poll.", "guestPollAlertTitle": "Your administrator rights can be lost if you clear your cookies", @@ -209,5 +208,6 @@ "clockPreferencesDescription": "Set your preferred time zone and time format.", "featureRequest": "Request a Feature", "bugReport": "Report an Issue", - "getSupport": "Get Support" + "getSupport": "Get Support", + "feedback": "Feedback" } diff --git a/apps/web/src/components/featurebase.tsx b/apps/web/src/components/featurebase.tsx index 3bba4e59b..05cd82819 100644 --- a/apps/web/src/components/featurebase.tsx +++ b/apps/web/src/components/featurebase.tsx @@ -1,22 +1,74 @@ +import { trpc } from "@rallly/backend"; +import { HelpCircleIcon } from "@rallly/icons"; +import { cn } from "@rallly/ui"; +import { Button } from "@rallly/ui/button"; import Script from "next/script"; import React from "react"; -import { useUser } from "@/components/user-provider"; +import { Trans } from "@/components/trans"; +import { isFeedbackEnabled } from "@/utils/constants"; -export const FeaturebaseProvider = ({ children }: React.PropsWithChildren) => { - const { user } = useUser(); +const FeaturebaseScript = () => ( +