Skip to content

Commit

Permalink
test hide
Browse files Browse the repository at this point in the history
  • Loading branch information
samlhuillier committed Nov 13, 2024
1 parent c9863e8 commit 868e425
Showing 1 changed file with 8 additions and 19 deletions.
27 changes: 8 additions & 19 deletions src/components/Editor/EditorManager.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const EditorManager: React.FC = () => {
const [contextMenuVisible, setContextMenuVisible] = useState(false)
const [menuPosition, setMenuPosition] = useState({ x: 0, y: 0 })
const [editorFlex, setEditorFlex] = useState(true)

const [showAIPopup, setShowAIPopup] = useState(false)
const { editor } = useFileContext()

const handleContextMenu = (event: React.MouseEvent<HTMLDivElement>) => {
Expand Down Expand Up @@ -52,24 +52,13 @@ const EditorManager: React.FC = () => {
editor={editor}
tippyOptions={{ duration: 100 }}
>
<button
onClick={() => editor.chain().focus().toggleBold().run()}
className={`rounded p-2 hover:bg-gray-700 ${editor.isActive('bold') ? 'bg-gray-700' : ''}`}
>
Bold
</button>
<button
onClick={() => editor.chain().focus().toggleItalic().run()}
className={`rounded p-2 hover:bg-gray-700 ${editor.isActive('italic') ? 'bg-gray-700' : ''}`}
>
Italic
</button>
<button
onClick={() => editor.chain().focus().toggleStrike().run()}
className={`rounded p-2 hover:bg-gray-700 ${editor.isActive('strike') ? 'bg-gray-700' : ''}`}
>
Strike
</button>
{showAIPopup ? (
<div>test hide</div>
) : (
<button onClick={() => setShowAIPopup(true)} className="rounded p-2 hover:bg-gray-700">
Ask AI
</button>
)}
</BubbleMenu>
)}
<SearchBar editor={editor} showSearch={showSearchBar} setShowSearch={setShowSearchBar} />
Expand Down

0 comments on commit 868e425

Please sign in to comment.