@@ -7,7 +7,7 @@ import { cn, isInternalHref, noReturnDebounce } from "@/lib/utils";
77import { CSSProperties , RefObject , useCallback , useEffect , useRef , useState } from "react" ;
88
99const IFRAME_DEFAULTS = {
10- WIDTH : 1440 ,
10+ WIDTH : 1440 , // Magic! Experiment with this for different iframed websites
1111 HEIGHT : 600 ,
1212} as const ;
1313
@@ -31,7 +31,7 @@ function createScaleTransformStyle(scale: number, hideTopPx: number = 0) {
3131}
3232
3333/**
34- * A hook to calculate the responsive scale of an element based on its container's width.
34+ * Resize the iframe zoom level to fit the container width to make it look normal
3535 */
3636function useResponsiveScale ( targetRef : RefObject < HTMLElement | null > , sourceWidth : number ) : number {
3737 const [ scale , setScale ] = useState ( 1 ) ;
@@ -58,17 +58,14 @@ type ResourceIframeProps = {
5858 className ?: string ;
5959 scale ?: number ;
6060 desktopWidth ?: number ;
61- /** Can be a number (px) or CSS height string (e.g. "100dvh"). */
6261 containerHeight ?: number | CSSProperties [ "height" ] ;
63- /** Number of pixels to hide from the top of the iframe content (pre-scale units). */
62+ /** Adjust this to hide Wix/WordPress ad headers */
6463 hideTopPx ?: number ;
65- /** Internal link to a full-page view. If provided, the header button links here instead of external site. */
64+ /** We host the iframe fullscreen ourselves, so we can link to it */
6665 fullPageHref ?: string ;
67- /** If true, omits the header (useful for full-page variant). */
66+ /** Useful for the full-page variant, which is just the iframe */
6867 hideHeader ?: boolean ;
69- /** If true, shows the iframe on mobile as well (not just md+). */
7068 showOnMobile ?: boolean ;
71- /** Optional small text line to display the author information. */
7269 authorLine ?: string ;
7370} ;
7471
0 commit comments