|
|
|
@ -1,4 +1,4 @@ |
|
|
|
|
import React, { useEffect, useRef, useState } from 'react' |
|
|
|
|
import React, { useContext, useEffect, useRef, useState } from 'react' |
|
|
|
|
import './style/remix-app.css' |
|
|
|
|
import { RemixUIMainPanel } from '@remix-ui/panel' |
|
|
|
|
import MatomoDialog from './components/modals/matomo' |
|
|
|
@ -8,6 +8,7 @@ import { AppProvider } from './context/provider' |
|
|
|
|
import AppDialogs from './components/modals/dialogs' |
|
|
|
|
import DialogViewPlugin from './components/modals/dialogViewPlugin' |
|
|
|
|
import { AppContext } from './context/context' |
|
|
|
|
import { RemixUiVerticalIconsPanel } from '@remix-ui/vertical-icons-panel' |
|
|
|
|
|
|
|
|
|
interface IRemixAppUi { |
|
|
|
|
app: any |
|
|
|
@ -17,31 +18,8 @@ const RemixApp = (props: IRemixAppUi) => { |
|
|
|
|
const [appReady, setAppReady] = useState<boolean>(false) |
|
|
|
|
const [hideSidePanel, setHideSidePanel] = useState<boolean>(false) |
|
|
|
|
const sidePanelRef = useRef(null) |
|
|
|
|
const mainPanelRef = useRef(null) |
|
|
|
|
const iconPanelRef = useRef(null) |
|
|
|
|
const hiddenPanelRef = useRef(null) |
|
|
|
|
|
|
|
|
|
useEffect(() => { |
|
|
|
|
if (sidePanelRef.current) { |
|
|
|
|
if (props.app.sidePanel) { |
|
|
|
|
sidePanelRef.current.appendChild(props.app.sidePanel.render()) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (mainPanelRef.current) { |
|
|
|
|
if (props.app.mainview) { |
|
|
|
|
mainPanelRef.current.appendChild(props.app.mainview.render()) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (iconPanelRef.current) { |
|
|
|
|
if (props.app.menuicons) { |
|
|
|
|
iconPanelRef.current.appendChild(props.app.menuicons.render()) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
if (hiddenPanelRef.current) { |
|
|
|
|
if (props.app.hiddenPanel) { |
|
|
|
|
hiddenPanelRef.current.appendChild(props.app.hiddenPanel.render()) |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
async function activateApp () { |
|
|
|
|
props.app.themeModule.initTheme(() => { |
|
|
|
|
setAppReady(true) |
|
|
|
@ -72,13 +50,6 @@ const RemixApp = (props: IRemixAppUi) => { |
|
|
|
|
}) |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const components = { |
|
|
|
|
iconPanel: <div ref={iconPanelRef} id="icon-panel" data-id="remixIdeIconPanel" className="iconpanel bg-light"></div>, |
|
|
|
|
sidePanel: <div ref={sidePanelRef} id="side-panel" data-id="remixIdeSidePanel" className={`sidepanel border-right border-left ${hideSidePanel ? 'd-none' : ''}`}></div>, |
|
|
|
|
mainPanel: <div ref={mainPanelRef} id="main-panel" data-id="remixIdeMainPanel" className='mainpanel'></div>, |
|
|
|
|
hiddenPanel: <div ref={hiddenPanelRef}></div> |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
const value = { |
|
|
|
|
settings: props.app.settings, |
|
|
|
|
showMatamo: props.app.showMatamo, |
|
|
|
@ -93,14 +64,14 @@ const RemixApp = (props: IRemixAppUi) => { |
|
|
|
|
<MatomoDialog hide={!appReady}></MatomoDialog> |
|
|
|
|
|
|
|
|
|
<div className={`remixIDE ${appReady ? '' : 'd-none'}`} data-id="remixIDE"> |
|
|
|
|
{components.iconPanel} |
|
|
|
|
{components.sidePanel} |
|
|
|
|
<div id="icon-panel" data-id="remixIdeIconPanel" className="iconpanel bg-light">{props.app.menuicons.render()}</div> |
|
|
|
|
<div ref={sidePanelRef} id="side-panel" data-id="remixIdeSidePanel" className={`sidepanel border-right border-left ${hideSidePanel ? 'd-none' : ''}`}>{props.app.sidePanel.render()}</div> |
|
|
|
|
<DragBar minWidth={250} refObject={sidePanelRef} hidden={hideSidePanel} setHideStatus={setHideSidePanel}></DragBar> |
|
|
|
|
<div id="main-panel" data-id="remixIdeMainPanel" className='mainpanel'> |
|
|
|
|
<RemixUIMainPanel Context={AppContext}></RemixUIMainPanel> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
{components.hiddenPanel} |
|
|
|
|
<div>{props.app.hiddenPanel.render()}</div> |
|
|
|
|
<AppDialogs></AppDialogs> |
|
|
|
|
<DialogViewPlugin></DialogViewPlugin> |
|
|
|
|
</AppProvider> |
|
|
|
|