If you don't want specific marketing elements to appear in the Marketplace iframe, this code override lets you hide them automatically.
↓↓↓
import { ComponentType } from "react"
const isInIframe = typeof window !== "undefined" && window.self !== window.top
const NullComponent = () => null
export function hideIfInIframe<P extends object>(
Component: ComponentType<P>
): ComponentType<P> {
return isInIframe ? NullComponent : Component
}
↑↑↑
Unfortunately, code blocks aren't supported here, only plain code lines. But it should still work
If you don't want specific marketing elements to appear in the Marketplace iframe, this code override lets you hide them automatically.
↓↓↓
import { ComponentType } from "react"
const isInIframe = typeof window !== "undefined" && window.self !== window.top
const NullComponent = () => null
export function hideIfInIframe<P extends object>(
Component: ComponentType<P>
): ComponentType<P> {
return isInIframe ? NullComponent : Component
}
↑↑↑
Unfortunately, code blocks aren't supported here, only plain code lines. But it should still work