Skip to content

Commit 9a5ce3d

Browse files
author
FalkWolsky
committed
Adapting Preview v2
1 parent 431e705 commit 9a5ce3d

File tree

2 files changed

+9
-27
lines changed

2 files changed

+9
-27
lines changed

client/packages/lowcoder/src/pages/common/previewHeader.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ const PreviewHeaderComp = () => {
220220
/>
221221

222222
{/* Orientation */}
223-
{/* editorState.deviceType !== 'desktop' && (
223+
{editorState.deviceType !== 'desktop' && (
224224
<Segmented<DeviceOrientation>
225225
options={[
226226
{ value: 'portrait', label: "Portrait" },
@@ -231,7 +231,7 @@ const PreviewHeaderComp = () => {
231231
editorState.setDeviceOrientation(value);
232232
}}
233233
/>
234-
) */}
234+
)}
235235
</>
236236
);
237237

client/packages/lowcoder/src/pages/editor/editorView.tsx

Lines changed: 7 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -339,16 +339,16 @@ const DeviceWrapper = ({
339339

340340
const deviceWidth = useMemo(() => {
341341
if (deviceType === 'tablet' && deviceOrientation === 'portrait') {
342-
return 700;
342+
return 980;
343343
}
344344
if (deviceType === 'tablet' && deviceOrientation === 'landscape') {
345-
return 900;
345+
return 1280;
346346
}
347347
if (deviceType === 'mobile' && deviceOrientation === 'portrait') {
348-
return 450;
348+
return 550;
349349
}
350350
if (deviceType === 'mobile' && deviceOrientation === 'landscape') {
351-
return 900;
351+
return 1200;
352352
}
353353
}, [deviceType, deviceOrientation]);
354354

@@ -489,30 +489,12 @@ function EditorView(props: EditorViewProps) {
489489

490490
return (
491491
editorState.deviceType === "mobile" || editorState.deviceType === "tablet" ? (
492-
<div style={{
493-
display: "flex",
494-
flexDirection: "row", // Arrange side by side
495-
gap: "20px", // Spacing between the two DeviceWrappers
496-
justifyContent: "center", // Center horizontally
497-
alignItems: "center", // Center vertically
498-
height: "auto", // Full viewport height for vertical centering
499-
width: "100%", // Full viewport width
500-
501-
}}>
502-
<DeviceWrapper
492+
<DeviceWrapper
503493
deviceType={editorState.deviceType}
504-
deviceOrientation="portrait"
494+
deviceOrientation={editorState.deviceOrientation}
505495
>
506496
{uiComp.getView()}
507-
</DeviceWrapper>
508-
509-
<DeviceWrapper
510-
deviceType={editorState.deviceType}
511-
deviceOrientation="landscape"
512-
>
513-
{uiComp.getView()}
514-
</DeviceWrapper>
515-
</div>
497+
</DeviceWrapper>
516498
) : (
517499
<div>
518500
{uiComp.getView()}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy