mirror of
https://github.com/Qortal/chrome-extension.git
synced 2025-03-27 15:55:55 +00:00
51 lines
1.4 KiB
TypeScript
51 lines
1.4 KiB
TypeScript
import React, { useContext, } from 'react';
|
|
import { AppViewer } from './AppViewer';
|
|
import Frame from 'react-frame-component';
|
|
import { MyContext, isMobile } from '../../App';
|
|
|
|
const AppViewerContainer = React.forwardRef(({ app, isSelected, hide, isDevMode, customHeight, skipAuth }, ref) => {
|
|
const { rootHeight } = useContext(MyContext);
|
|
|
|
|
|
return (
|
|
<Frame
|
|
id={`browser-iframe-${app?.tabId}`}
|
|
|
|
head={
|
|
<>
|
|
<style>
|
|
{`
|
|
body {
|
|
margin: 0;
|
|
padding: 0;
|
|
}
|
|
* {
|
|
-ms-overflow-style: none; /* IE and Edge */
|
|
scrollbar-width: none; /* Firefox */
|
|
}
|
|
*::-webkit-scrollbar {
|
|
display: none; /* Chrome, Safari, Opera */
|
|
}
|
|
.frame-content {
|
|
overflow: hidden;
|
|
height: ${!isMobile ? '100vh' : `calc(${rootHeight} - 60px - 45px)`};
|
|
}
|
|
`}
|
|
</style>
|
|
</>
|
|
}
|
|
style={{
|
|
display: (!isSelected || hide) && 'none',
|
|
height: customHeight ? customHeight : !isMobile ? '100vh' : `calc(${rootHeight} - 60px - 45px)`,
|
|
border: 'none',
|
|
width: '100%',
|
|
overflow: 'hidden',
|
|
}}
|
|
>
|
|
<AppViewer app={app} ref={ref} hide={!isSelected || hide} isDevMode={isDevMode} skipAuth={skipAuth} />
|
|
</Frame>
|
|
);
|
|
});
|
|
|
|
export default AppViewerContainer;
|