Skip to content

Commit 52bce45

Browse files
authored
fix: The CLI and Server window gets cleared when switching to Preview(#2618)
1 parent ce51e91 commit 52bce45

File tree

1 file changed

+9
-5
lines changed
  • apps/web/client/src/app/project/[id]/_components/bottom-bar

1 file changed

+9
-5
lines changed

apps/web/client/src/app/project/[id]/_components/bottom-bar/index.tsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,11 +68,12 @@ export const BottomBar = observer(() => {
6868

6969
return (
7070
<AnimatePresence mode="wait">
71-
{editorEngine.state.editorMode !== EditorMode.PREVIEW && (
72-
<motion.div
71+
<motion.div
7372
initial={{ opacity: 0, y: 20 }}
74-
animate={{ opacity: 1, y: 0 }}
75-
exit={{ opacity: 0, y: 20 }}
73+
animate={{
74+
opacity: editorEngine.state.editorMode !== EditorMode.PREVIEW ? 1 : 0,
75+
y: editorEngine.state.editorMode !== EditorMode.PREVIEW ? 0 : 20,
76+
}}
7677
className="absolute left-1/2 -translate-x-1/2 bottom-4 flex flex-col border-[0.5px] border-border p-1 px-1 bg-background rounded-lg backdrop-blur drop-shadow-xl overflow-hidden"
7778
transition={{
7879
type: 'spring',
@@ -81,6 +82,10 @@ export const BottomBar = observer(() => {
8182
stiffness: 200,
8283
damping: 25,
8384
}}
85+
style={{
86+
pointerEvents: editorEngine.state.editorMode !== EditorMode.PREVIEW ? 'auto' : 'none',
87+
visibility: editorEngine.state.editorMode !== EditorMode.PREVIEW ? 'visible' : 'hidden'
88+
}}
8489
>
8590
<TerminalArea>
8691
<ToggleGroup
@@ -119,7 +124,6 @@ export const BottomBar = observer(() => {
119124
</ToggleGroup>
120125
</TerminalArea>
121126
</motion.div>
122-
)}
123127
</AnimatePresence>
124128
);
125129
});

0 commit comments

Comments
 (0)