Skip to content

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

🚧 Add space branding to invite page (#2314)

Luke Vella630e5850d53e
diff --git a/apps/web/src/app/[locale]/(optional-space)/poll/[urlId]/admin-page.tsx b/apps/web/src/app/[locale]/(optional-space)/poll/[urlId]/admin-page.tsx
index 1da1d3d9f..04b67fc9b 100644
--- a/apps/web/src/app/[locale]/(optional-space)/poll/[urlId]/admin-page.tsx
+++ b/apps/web/src/app/[locale]/(optional-space)/poll/[urlId]/admin-page.tsx
@@ -1,13 +1,13 @@
"use client";
import Discussion from "@/components/discussion";
import { EventCard } from "@/components/event-card";
+import { PollBranding } from "@/components/poll/poll-branding";
import { PollFooter } from "@/components/poll/poll-footer";
import { PollViewTracker } from "@/components/poll/poll-view-tracker";
import { ResponsiveResults } from "@/components/poll/responsive-results";
import { ScheduledEvent } from "@/components/poll/scheduled-event";
import { VotingForm } from "@/components/poll/voting-form";
import { usePoll } from "@/contexts/poll";
-
import { GuestPollAlert } from "./guest-poll-alert";
export function AdminPage() {
@@ -16,6 +16,9 @@ export function AdminPage() {
return (
<div className="space-y-3 lg:space-y-4">
+ {poll.space?.showBranding && poll.space.primaryColor ? (
+ <PollBranding primaryColor={poll.space.primaryColor} />
+ ) : null}
{/* Track poll views */}
<PollViewTracker pollId={poll.id} />
<GuestPollAlert />
diff --git a/apps/web/src/app/[locale]/invite/[urlId]/invite-page.tsx b/apps/web/src/app/[locale]/invite/[urlId]/invite-page.tsx
index 8ea538fd1..c26c83480 100644
--- a/apps/web/src/app/[locale]/invite/[urlId]/invite-page.tsx
+++ b/apps/web/src/app/[locale]/invite/[urlId]/invite-page.tsx
@@ -4,6 +4,7 @@ import { ArrowUpRightIcon, CrownIcon } from "lucide-react";
import Link from "next/link";
import Discussion from "@/components/discussion";
import { EventCard } from "@/components/event-card";
+import { PollBranding } from "@/components/poll/poll-branding";
import { PollFooter } from "@/components/poll/poll-footer";
import { PollViewTracker } from "@/components/poll/poll-view-tracker";
import { ResponsiveResults } from "@/components/poll/responsive-results";
@@ -51,7 +52,9 @@ export function InvitePage() {
return (
<div className="page-bg-gray-100 h-dvh overflow-auto p-3 lg:p-6 dark:bg-gray-900">
- <div className="page-bg-gray-100 hidden" />
+ {poll.space?.showBranding && poll.space.primaryColor ? (
+ <PollBranding primaryColor={poll.space.primaryColor} />
+ ) : null}
<PollViewTracker pollId={poll.id} />
<div className="mx-auto w-full max-w-4xl space-y-3">
<GoToApp />
diff --git a/apps/web/src/components/poll/poll-branding.tsx b/apps/web/src/components/poll/poll-branding.tsx
new file mode 100644
index 000000000..156ccab40
--- /dev/null
+++ b/apps/web/src/components/poll/poll-branding.tsx
@@ -0,0 +1,20 @@
+"use client";
+
+import { getPrimaryColorVars } from "@/features/branding/color";
+
+export function PollBranding({ primaryColor }: { primaryColor: string }) {
+ const primaryColorVars = getPrimaryColorVars(primaryColor);
+
+ return (
+ <style>{`
+ .light {
+ --primary: ${primaryColorVars.light};
+ --primary-foreground: ${primaryColorVars.lightForeground};
+ }
+ .dark {
+ --primary: ${primaryColorVars.dark};
+ --primary-foreground: ${primaryColorVars.darkForeground};
+ }
+ `}</style>
+ );
+}