From e97984d94a3db6ac07998c8a900f1e7ee87d7ba2 Mon Sep 17 00:00:00 2001 From: Sahaj Jain Date: Fri, 11 Apr 2025 23:49:12 +0530 Subject: [PATCH] Revert "feat: Add animated code panel collapse" This reverts commit 70a8d702145deca39c4333ad428adca9adbedd69. --- src/components/editor/editor.tsx | 42 ++++++++++---------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/src/components/editor/editor.tsx b/src/components/editor/editor.tsx index 4b3721c9..fa3f99e8 100644 --- a/src/components/editor/editor.tsx +++ b/src/components/editor/editor.tsx @@ -1,4 +1,4 @@ -import React, { useState, useRef, useEffect } from "react"; +import React, { useState } from "react"; import { ResizablePanelGroup, ResizablePanel, @@ -10,7 +10,6 @@ import { ThemeStyles } from "@/types/theme"; import CodePanel from "./code-panel"; import { Sliders } from "lucide-react"; import { useEditorStore } from "@/store/editor-store"; -import { motion, AnimatePresence } from "motion/react"; interface EditorProps { config: EditorConfig; @@ -26,11 +25,6 @@ const Editor: React.FC = ({ config }) => { const Controls = config.controls; const Preview = config.preview; const [isCodePanelOpen, setIsCodePanelOpen] = useState(true); - const isFirstMount = useRef(true); - - useEffect(() => { - isFirstMount.current = false; - }, []); const handleStyleChange = (newStyles: ThemeStyles) => { setThemeState({ ...themeState, styles: newStyles }); @@ -68,28 +62,18 @@ const Editor: React.FC = ({ config }) => { - - {isCodePanelOpen && ( - <> - - - - setIsCodePanelOpen(!isCodePanelOpen)} - /> - - - - )} - + {isCodePanelOpen && ( + <> + + + setIsCodePanelOpen(!isCodePanelOpen)} + /> + + + )}