19 lines
1.1 KiB
Python
Executable file
19 lines
1.1 KiB
Python
Executable file
import re
|
|
|
|
with open('c:/ScriptoriumAI/scriptoriumai-ui/src/layouts/EditorLayout.tsx', 'r', encoding='utf-8') as f:
|
|
text = f.read()
|
|
|
|
# Add Menu icon
|
|
text = text.replace("import { Command, Sparkles } from 'lucide-react'", "import { Command, Sparkles, Menu } from 'lucide-react'")
|
|
|
|
# Add state
|
|
text = text.replace("const [isCommandPaletteOpen, setIsCommandPaletteOpen] = useState(false)", "const [isCommandPaletteOpen, setIsCommandPaletteOpen] = useState(false)\n const [isMobileMenuOpen, setIsMobileMenuOpen] = useState(false)")
|
|
|
|
# Add button
|
|
text = re.sub(r'(<div className="flex items-center gap-2">)', r'<button onClick={() => setIsMobileMenuOpen(!isMobileMenuOpen)} className="md:hidden p-1 mr-2 text-gray-400 hover:text-gray-100">\n <Menu size={20} />\n </button>\n \1', text)
|
|
|
|
# Adjust sidebar classes to be an overlay on mobile
|
|
text = text.replace('className="col-span-2 hidden md:flex overflow-hidden"', 'className={col-span-12 md:col-span-2 overflow-hidden }')
|
|
|
|
with open('c:/ScriptoriumAI/scriptoriumai-ui/src/layouts/EditorLayout.tsx', 'w', encoding='utf-8') as f:
|
|
f.write(text)
|