|
4 | 4 | UniversalPlayground,
|
5 | 5 | globalThemeConfig,
|
6 | 6 | } from '@midscene/visualizer';
|
7 |
| -import { Col, ConfigProvider, Layout, Row } from 'antd'; |
| 7 | +import { ConfigProvider, Layout } from 'antd'; |
| 8 | +import { Panel, PanelGroup, PanelResizeHandle } from 'react-resizable-panels'; |
8 | 9 | import { useEffect, useMemo, useState } from 'react';
|
9 | 10 | import ScreenshotViewer from './components/screenshot-viewer';
|
10 | 11 |
|
@@ -84,53 +85,58 @@ export default function App() {
|
84 | 85 | <ConfigProvider theme={globalThemeConfig()}>
|
85 | 86 | <Layout className="app-container playground-container">
|
86 | 87 | <Content className="app-content">
|
87 |
| - <div className="app-grid-layout"> |
88 |
| - <Row className="app-grid-layout"> |
89 |
| - {/* Left panel: UniversalPlayground */} |
90 |
| - <Col className="app-panel left-panel"> |
91 |
| - <div className="panel-content left-panel-content"> |
92 |
| - {/* Header with Logo and Config */} |
93 |
| - <div className="playground-panel-header"> |
94 |
| - <div className="header-row"> |
95 |
| - <Logo /> |
96 |
| - {/* <EnvConfig /> */} |
97 |
| - </div> |
98 |
| - </div> |
99 |
| - |
100 |
| - {/* Main playground area */} |
101 |
| - <div className="playground-panel-playground"> |
102 |
| - <UniversalPlayground |
103 |
| - playgroundSDK={playgroundSDK} |
104 |
| - config={{ |
105 |
| - showContextPreview: false, |
106 |
| - layout: 'vertical', |
107 |
| - showVersionInfo: true, |
108 |
| - enableScrollToBottom: true, |
109 |
| - serverMode: true, |
110 |
| - showEnvConfigReminder: false, |
111 |
| - }} |
112 |
| - branding={{ |
113 |
| - title: 'Playground', |
114 |
| - version: __APP_VERSION__, |
115 |
| - }} |
116 |
| - className="playground-container" |
117 |
| - /> |
| 88 | + <PanelGroup autoSaveId="playground-layout" direction="horizontal"> |
| 89 | + {/* Left panel: UniversalPlayground */} |
| 90 | + <Panel |
| 91 | + defaultSize={32} |
| 92 | + maxSize={60} |
| 93 | + minSize={20} |
| 94 | + className="app-panel left-panel" |
| 95 | + > |
| 96 | + <div className="panel-content left-panel-content"> |
| 97 | + {/* Header with Logo and Config */} |
| 98 | + <div className="playground-panel-header"> |
| 99 | + <div className="header-row"> |
| 100 | + <Logo /> |
| 101 | + {/* <EnvConfig /> */} |
118 | 102 | </div>
|
119 | 103 | </div>
|
120 |
| - </Col> |
121 | 104 |
|
122 |
| - {/* Right panel: Screenshot Viewer */} |
123 |
| - <Col className="app-panel right-panel"> |
124 |
| - <div className="panel-content right-panel-content"> |
125 |
| - <ScreenshotViewer |
| 105 | + {/* Main playground area */} |
| 106 | + <div className="playground-panel-playground"> |
| 107 | + <UniversalPlayground |
126 | 108 | playgroundSDK={playgroundSDK}
|
127 |
| - serverOnline={serverOnline} |
128 |
| - isUserOperating={isUserOperating} |
| 109 | + config={{ |
| 110 | + showContextPreview: false, |
| 111 | + layout: 'vertical', |
| 112 | + showVersionInfo: true, |
| 113 | + enableScrollToBottom: true, |
| 114 | + serverMode: true, |
| 115 | + showEnvConfigReminder: false, |
| 116 | + }} |
| 117 | + branding={{ |
| 118 | + title: 'Playground', |
| 119 | + version: __APP_VERSION__, |
| 120 | + }} |
| 121 | + className="playground-container" |
129 | 122 | />
|
130 | 123 | </div>
|
131 |
| - </Col> |
132 |
| - </Row> |
133 |
| - </div> |
| 124 | + </div> |
| 125 | + </Panel> |
| 126 | + |
| 127 | + <PanelResizeHandle className="panel-resize-handle" /> |
| 128 | + |
| 129 | + {/* Right panel: Screenshot Viewer */} |
| 130 | + <Panel className="app-panel right-panel"> |
| 131 | + <div className="panel-content right-panel-content"> |
| 132 | + <ScreenshotViewer |
| 133 | + playgroundSDK={playgroundSDK} |
| 134 | + serverOnline={serverOnline} |
| 135 | + isUserOperating={isUserOperating} |
| 136 | + /> |
| 137 | + </div> |
| 138 | + </Panel> |
| 139 | + </PanelGroup> |
134 | 140 | </Content>
|
135 | 141 | </Layout>
|
136 | 142 | </ConfigProvider>
|
|
0 commit comments