mirror of
https://github.com/Qortal/Qortal-Hub.git
synced 2025-06-14 20:11:22 +00:00
Add types
This commit is contained in:
parent
be5c3af318
commit
1f5a604932
@ -7,7 +7,14 @@ import { useQortalMessageListener } from '../../hooks/useQortalMessageListener';
|
||||
import { useThemeContext } from '../Theme/ThemeContext';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
|
||||
export const AppViewer = forwardRef(
|
||||
type AppViewerProps = {
|
||||
app: any;
|
||||
hide: boolean;
|
||||
isDevMode: boolean;
|
||||
skipAuth?: boolean;
|
||||
};
|
||||
|
||||
export const AppViewer = forwardRef<HTMLIFrameElement, AppViewerProps>(
|
||||
({ app, hide, isDevMode, skipAuth }, iframeRef) => {
|
||||
const { window: frameWindow } = useFrame();
|
||||
const { path, history, changeCurrentIndex, resetHistory } =
|
||||
|
@ -2,15 +2,26 @@ import { forwardRef } from 'react';
|
||||
import { AppViewer } from './AppViewer';
|
||||
import Frame from 'react-frame-component';
|
||||
|
||||
const AppViewerContainer = forwardRef(
|
||||
({ app, isSelected, hide, isDevMode, customHeight, skipAuth }, ref) => {
|
||||
return (
|
||||
<Frame
|
||||
id={`browser-iframe-${app?.tabId}`}
|
||||
head={
|
||||
<>
|
||||
<style>
|
||||
{`
|
||||
type AppViewerContainerProps = {
|
||||
app: any; // Replace `any` with the correct type of `tab` if available
|
||||
isSelected: boolean;
|
||||
hide: boolean;
|
||||
isDevMode: boolean;
|
||||
customHeight?: string;
|
||||
skipAuth?: boolean;
|
||||
};
|
||||
|
||||
const AppViewerContainer = forwardRef<
|
||||
HTMLIFrameElement,
|
||||
AppViewerContainerProps
|
||||
>(({ app, isSelected, hide, isDevMode, customHeight, skipAuth }, ref) => {
|
||||
return (
|
||||
<Frame
|
||||
id={`browser-iframe-${app?.tabId}`}
|
||||
head={
|
||||
<>
|
||||
<style>
|
||||
{`
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
@ -27,28 +38,27 @@ const AppViewerContainer = forwardRef(
|
||||
height: 100vh;
|
||||
}
|
||||
`}
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
style={{
|
||||
border: 'none',
|
||||
height: customHeight || '100vh',
|
||||
left: (!isSelected || hide) && '-200vw',
|
||||
overflow: 'hidden',
|
||||
position: (!isSelected || hide) && 'fixed',
|
||||
width: '100%',
|
||||
}}
|
||||
>
|
||||
<AppViewer
|
||||
app={app}
|
||||
hide={!isSelected || hide}
|
||||
isDevMode={isDevMode}
|
||||
ref={ref}
|
||||
skipAuth={skipAuth}
|
||||
/>
|
||||
</Frame>
|
||||
);
|
||||
}
|
||||
);
|
||||
</style>
|
||||
</>
|
||||
}
|
||||
style={{
|
||||
border: 'none',
|
||||
height: customHeight || '100vh',
|
||||
left: (!isSelected || hide) && '-200vw',
|
||||
overflow: 'hidden',
|
||||
position: (!isSelected || hide) && 'fixed',
|
||||
width: '100%',
|
||||
}}
|
||||
>
|
||||
<AppViewer
|
||||
app={app}
|
||||
hide={!isSelected || hide}
|
||||
isDevMode={isDevMode}
|
||||
ref={ref}
|
||||
skipAuth={skipAuth}
|
||||
/>
|
||||
</Frame>
|
||||
);
|
||||
});
|
||||
|
||||
export default AppViewerContainer;
|
||||
|
Loading…
x
Reference in New Issue
Block a user