Pass forward the backupIframeRef now

This commit is contained in:
Gigiaj 2025-05-08 18:41:26 -05:00
parent 43ce6f0210
commit 8b2fa10679

View file

@ -1,10 +1,10 @@
import React, { ComponentProps, MutableRefObject, ReactNode } from 'react'; import React, { ComponentProps, MutableRefObject, ReactNode } from 'react';
import { Box, Header, Line, Scroll, Text, as } from 'folds'; import { Box, Header, Line, Scroll, Text, as } from 'folds';
import classNames from 'classnames'; import classNames from 'classnames';
import { Outlet, useOutletContext } from 'react-router-dom';
import { ContainerColor } from '../../styles/ContainerColor.css'; import { ContainerColor } from '../../styles/ContainerColor.css';
import * as css from './style.css'; import * as css from './style.css';
import { ScreenSize, useScreenSizeContext } from '../../hooks/useScreenSize'; import { ScreenSize, useScreenSizeContext } from '../../hooks/useScreenSize';
import { Outlet, useOutletContext } from 'react-router-dom';
type PageRootProps = { type PageRootProps = {
nav: ReactNode; nav: ReactNode;
@ -13,7 +13,7 @@ type PageRootProps = {
export function PageRoot({ nav, children }: PageRootProps) { export function PageRoot({ nav, children }: PageRootProps) {
const screenSize = useScreenSizeContext(); const screenSize = useScreenSizeContext();
const { iframeRef } = useOutletContext(); const { iframeRef, backupIframeRef } = useOutletContext();
return ( return (
<Box grow="Yes" className={ContainerColor({ variant: 'Background' })}> <Box grow="Yes" className={ContainerColor({ variant: 'Background' })}>
@ -21,7 +21,7 @@ export function PageRoot({ nav, children }: PageRootProps) {
{screenSize !== ScreenSize.Mobile && ( {screenSize !== ScreenSize.Mobile && (
<Line variant="Background" size="300" direction="Vertical" /> <Line variant="Background" size="300" direction="Vertical" />
)} )}
<Outlet context={{ iframeRef }} /> <Outlet context={{ iframeRef, backupIframeRef }} />
</Box> </Box>
); );
} }