Rallly is an open-source scheduling and collaboration tool designed to make organizing events and meetings easier.
TypeScript i18nextnext-authnextjspostgresqlprismareact-emailt3-stacktailwindcsstrpcturborepotypescriptzod
✨ Add custom branding prompt (#2326)
Luke Vellaafe3b860a396
diff --git a/apps/web/public/images/branded-poll.webp b/apps/web/public/images/branded-poll.webpnew file mode 100644index 000000000..86ebfd5eaBinary files /dev/null and b/apps/web/public/images/branded-poll.webp differdiff --git a/apps/web/public/locales/en/app.json b/apps/web/public/locales/en/app.jsonindex 78027d607..ed8f5a0dc 100644--- a/apps/web/public/locales/en/app.json+++ b/apps/web/public/locales/en/app.json@@ -623,5 +623,10 @@"showBrandingDescription": "Show your brand identity on your public pages and emails","useCustomBranding": "Enable Custom Branding","customBranding": "Custom Branding",- "customBrandingDescription": "Show your logo and brand colors to your participants"+ "customBrandingDescription": "Show your logo and brand colors to your participants",+ "customBrandingPromptTitle": "Custom Branding",+ "customBrandingPromptDescription": "You're on the Pro plan. Add your brand colors to polls and emails.",+ "customBrandingPromptCta": "Set Up Now",+ "dismiss": "Dismiss",+ "new": "New"}diff --git a/apps/web/src/app/[locale]/(space)/(dashboard)/layout.tsx b/apps/web/src/app/[locale]/(space)/(dashboard)/layout.tsxindex 77206e69b..55230f19d 100644--- a/apps/web/src/app/[locale]/(space)/(dashboard)/layout.tsx+++ b/apps/web/src/app/[locale]/(space)/(dashboard)/layout.tsx@@ -15,6 +15,7 @@ import { dehydrate, HydrationBoundary } from "@tanstack/react-query";import { SettingsIcon } from "lucide-react";import Link from "next/link";import { NavUser } from "@/components/nav-user";+import { CustomBrandingPrompt } from "@/features/branding/components/custom-branding-prompt";import { LicenseLimitWarning } from "@/features/licensing/components/license-limit-warning";import { CommandMenu } from "@/features/navigation/command-menu";import { SpaceDropdown } from "@/features/space/components/space-dropdown";@@ -77,6 +78,7 @@ export default async function Layout({</Sidebar><SidebarInset className="min-w-0"><LicenseLimitWarning />+ <CustomBrandingPrompt /><div className="flex flex-1 flex-col"><div className="flex flex-1 flex-col">{children}</div></div>diff --git a/apps/web/src/features/branding/components/custom-branding-prompt.tsx b/apps/web/src/features/branding/components/custom-branding-prompt.tsxnew file mode 100644index 000000000..90aeb74d6--- /dev/null+++ b/apps/web/src/features/branding/components/custom-branding-prompt.tsx@@ -0,0 +1,95 @@+"use client";++import { usePostHog } from "@rallly/posthog/client";+import { Badge } from "@rallly/ui/badge";+import { Button } from "@rallly/ui/button";+import Image from "next/image";+import Link from "next/link";+import React from "react";+import { useLocalStorage } from "react-use";+import { useSpace } from "@/features/space/client";+import { Trans, useTranslation } from "@/i18n/client";++export function CustomBrandingPrompt() {+ const { t } = useTranslation();+ const { data: space } = useSpace();+ const posthog = usePostHog();++ const [isDismissed, setIsDismissed] = useLocalStorage(+ `custom-branding-prompt-dismissed-${space.id}`,+ false,+ );++ const [showPrompt, setShowPrompt] = React.useState(false);++ React.useEffect(() => {+ if (space.tier === "hobby" || space.showBranding) {+ return;+ }+ setShowPrompt(true);+ }, [space.showBranding, space.tier]);++ if (isDismissed || !showPrompt) {+ return null;+ }++ return (+ <div className="fixed right-4 bottom-4 z-50 w-96 overflow-hidden rounded-xl border border-popover-border bg-popover shadow-lg">+ <div className="relative h-40">+ <Image+ src="/images/branded-poll.webp"+ alt={t("customBrandingPromptTitle", {+ defaultValue: "Custom Branding",+ })}+ fill+ sizes="384px"+ style={{+ objectFit: "cover",+ objectPosition: "top",+ }}+ />+ </div>+ <div className="p-4">+ <div className="flex items-center gap-x-2">+ <h2 className="font-semibold text-sm">+ <Trans+ i18nKey="customBrandingPromptTitle"+ defaults="Custom Branding"+ />+ </h2>+ <Badge size="sm" variant="secondary">+ <Trans i18nKey="new" defaults="New" />+ </Badge>+ </div>+ <p className="mt-2 text-muted-foreground text-sm leading-relaxed">+ <Trans+ i18nKey="customBrandingPromptDescription"+ defaults="You're on the Pro plan. Add your brand colors to polls and emails."+ />+ </p>+ <div className="mt-6 flex gap-2">+ <Button+ variant="primary"+ className="flex-1"+ nativeButton={false}+ render={<Link href="/settings/general" />}+ onClick={() =>+ posthog?.capture("custom_branding_prompt:setup_click")+ }+ >+ <Trans i18nKey="customBrandingPromptCta" defaults="Set Up Now" />+ </Button>+ <Button+ className="flex-1"+ onClick={() => {+ posthog?.capture("custom_branding_prompt:dismiss_click");+ setIsDismissed(true);+ }}+ >+ <Trans i18nKey="dismiss" defaults="Dismiss" />+ </Button>+ </div>+ </div>+ </div>+ );+}