diff --git a/client/src/placement-context.tsx b/client/src/placement-context.tsx index ed5eeb288bbb..2dc2a6990cbc 100644 --- a/client/src/placement-context.tsx +++ b/client/src/placement-context.tsx @@ -14,7 +14,13 @@ export enum Status { empty = "empty", } -type PlacementType = "side" | "top" | "hpMain" | "hpFooter" | "bottom"; +type PlacementType = + | "side" + | "top" + | "hpTop" + | "hpMain" + | "hpFooter" + | "bottom"; export interface PlacementContextData extends Partial> { plusAvailable?: boolean; @@ -31,6 +37,10 @@ const PLACEMENT_MAP: Record = { typ: "top-banner", pattern: /\/[^/]+\/(?!$|_homepage$).*/i, }, + hpTop: { + typ: "top-banner", + pattern: /\/[^/]+\/($|_homepage$)/i, + }, hpMain: { typ: "hp-main", pattern: /\/[^/]+\/($|_homepage$)/i, diff --git a/client/src/ui/organisms/placement/index.tsx b/client/src/ui/organisms/placement/index.tsx index 6677d16601ef..b2bfd2a24e97 100644 --- a/client/src/ui/organisms/placement/index.tsx +++ b/client/src/ui/organisms/placement/index.tsx @@ -127,6 +127,7 @@ function TopPlacementFallbackContent() { export function TopPlacement() { const isServer = useIsServer(); const placementData = usePlacement(); + const data = placementData?.hpTop || placementData?.top; const { textColor, backgroundColor, @@ -136,7 +137,7 @@ export function TopPlacement() { backgroundColorDark, ctaTextColorDark, ctaBackgroundColorDark, - } = placementData?.top?.colors || {}; + } = data?.colors || {}; const css = Object.fromEntries( [ ["--place-top-background-light", backgroundColor], @@ -156,13 +157,13 @@ export function TopPlacement() { const status = isServer || placementData?.status === Status.loading ? "loading" - : placementData?.top + : data ? "visible" : "fallback"; return (
- {isServer || !placementData?.top ? ( + {isServer || !data ? (
{!isServer && placementData?.status !== Status.loading && ( @@ -170,9 +171,9 @@ export function TopPlacement() {
) : (