Skip to content

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

🚸 Gate primary color saves behind the paywall for hobby spaces (#2937)

Luke Vella93b0209d2384
diff --git a/apps/web/src/app/[locale]/(space)/settings/general/components/custom-branding-section.tsx b/apps/web/src/app/[locale]/(space)/settings/general/components/custom-branding-section.tsx
index d84bf7bfc..bcc4ab24a 100644
--- a/apps/web/src/app/[locale]/(space)/settings/general/components/custom-branding-section.tsx
+++ b/apps/web/src/app/[locale]/(space)/settings/general/components/custom-branding-section.tsx
@@ -87,7 +87,14 @@ export function CustomBrandingSection({
}
};
- const handleSave = () => persistColor(isDefault ? null : hexColor);
+ const handleSave = () => {
+ if (isFree) {
+ showPayWall({ from: "custom-branding", setting: "primary_color" });
+ return;
+ }
+
+ return persistColor(isDefault ? null : hexColor);
+ };
// Clearing the column is what "default" means in the database, so reset
// writes null rather than storing the default value literally.
diff --git a/apps/web/src/features/space/actions.ts b/apps/web/src/features/space/actions.ts
index 18f4bb2f4..6d028a419 100644
--- a/apps/web/src/features/space/actions.ts
+++ b/apps/web/src/features/space/actions.ts
@@ -181,6 +181,13 @@ export const updateSpaceAction = authActionClient
.action(async ({ ctx, parsedInput }) => {
const { space } = ctx;
+ if (parsedInput.primaryColor && space.tier !== "pro") {
+ throw new AppError({
+ code: "PAYMENT_REQUIRED",
+ message: "You need a Pro subscription to set a primary color",
+ });
+ }
+
await updateSpace({
spaceId: space.id,
name: parsedInput.name,