Skip to content

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

🐛 Sync the branding page preview with the actual logo viewbox (#2985)

Luke Vellac80fab8628bc
diff --git a/apps/web/src/app/[locale]/control-panel/branding/components/logo-upload-field.tsx b/apps/web/src/app/[locale]/control-panel/branding/components/logo-upload-field.tsx
index acb6bb91a..3c1df4457 100644
--- a/apps/web/src/app/[locale]/control-panel/branding/components/logo-upload-field.tsx
+++ b/apps/web/src/app/[locale]/control-panel/branding/components/logo-upload-field.tsx
@@ -2,6 +2,7 @@
import { cn } from "@rallly/ui";
import { ImageUploadControl } from "@/components/image-upload";
+import { LOGO_VIEWBOX } from "@/features/branding/constants";
import { brandingLogoProfiles } from "@/features/instance-settings/constants";
import type { BrandingLogoType } from "@/features/instance-settings/schema";
import { useSafeAction } from "@/lib/safe-action/client";
@@ -51,16 +52,19 @@ export function LogoUploadField({
return (
<div className="w-full space-y-3">
- {/* Full-width preview of the 200x160 slot the logo renders in. The
- cell's guide lines are oversized and clipped by the strip, so they
- run edge to edge. */}
+ {/* Full-width preview of the slot the logo renders in. The cell's guide
+ lines are oversized and clipped by the strip, so they run edge to
+ edge. */}
<div
className={cn(
"flex w-full items-center justify-center overflow-hidden rounded-lg border py-10",
previewVariants[logoType].container,
)}
>
- <div className="relative flex h-40 w-50 items-center justify-center">
+ <div
+ className="relative flex items-center justify-center"
+ style={{ width: LOGO_VIEWBOX.width, height: LOGO_VIEWBOX.height }}
+ >
{logoType !== "logoIcon" ? (
<>
<div
@@ -98,7 +102,7 @@ export function LogoUploadField({
previewVariants[logoType].label,
)}
>
- 200px
+ {LOGO_VIEWBOX.width}px
</span>
<span
aria-hidden="true"
@@ -107,7 +111,7 @@ export function LogoUploadField({
previewVariants[logoType].label,
)}
>
- 160px
+ {LOGO_VIEWBOX.height}px
</span>
</>
) : null}
diff --git a/apps/web/src/features/branding/components/logo.tsx b/apps/web/src/features/branding/components/logo.tsx
index 8dd8778f4..c3cdf2830 100644
--- a/apps/web/src/features/branding/components/logo.tsx
+++ b/apps/web/src/features/branding/components/logo.tsx
@@ -1,5 +1,6 @@
import { cn } from "@rallly/ui";
import { env } from "@/env";
+import { LOGO_VIEWBOX } from "@/features/branding/constants";
import { getInstanceBrandingConfig } from "@/features/branding/data";
const sizes = {
@@ -23,7 +24,8 @@ export const Logo = async ({
if (size === "fit") {
return (
<div
- className={cn("flex h-32 w-48 items-center justify-center", className)}
+ className={cn("flex items-center justify-center", className)}
+ style={{ width: LOGO_VIEWBOX.width, height: LOGO_VIEWBOX.height }}
>
{/* biome-ignore lint/performance/noImgElement: we don't need Image component here */}
<img
diff --git a/apps/web/src/features/branding/constants.ts b/apps/web/src/features/branding/constants.ts
index 26f497ffe..c49465f12 100644
--- a/apps/web/src/features/branding/constants.ts
+++ b/apps/web/src/features/branding/constants.ts
@@ -7,5 +7,6 @@ export const DEFAULT_LOGO_ICON_URL = absoluteUrl(
"/images/rallly-logo-mark.png",
);
export const DEFAULT_APP_NAME = "Rallly";
+export const LOGO_VIEWBOX = { width: 192, height: 128 };
export const LIGHT_MODE_BACKGROUND = "#ffffff";
export const DARK_MODE_BACKGROUND = "#171717";