refactor: remove dark mode functionality from text editor components
This commit is contained in:
@@ -15,11 +15,9 @@ import {
|
||||
LinkIcon,
|
||||
LinkSlashIcon,
|
||||
ListBulletIcon,
|
||||
MoonIcon,
|
||||
NumberedListIcon,
|
||||
PhotoIcon,
|
||||
StrikethroughIcon,
|
||||
SunIcon,
|
||||
SwatchIcon,
|
||||
} from '@heroicons/react/20/solid'
|
||||
import type { Editor } from '@tiptap/react'
|
||||
@@ -41,8 +39,6 @@ type TProperties = {
|
||||
editor: Editor | null
|
||||
setIsPlainHTML: Dispatch<SetStateAction<boolean>>
|
||||
category: string
|
||||
darkMode: boolean
|
||||
setDarkMode: Dispatch<SetStateAction<boolean>>
|
||||
disabled?: boolean
|
||||
}
|
||||
|
||||
@@ -51,8 +47,6 @@ export const EditorMenuBar = (properties: TProperties) => {
|
||||
editor,
|
||||
setIsPlainHTML,
|
||||
// category,
|
||||
darkMode,
|
||||
setDarkMode,
|
||||
disabled = false,
|
||||
} = properties
|
||||
// const [isOpenImage, setIsOpenImage] = useState(false)
|
||||
@@ -114,11 +108,6 @@ export const EditorMenuBar = (properties: TProperties) => {
|
||||
}
|
||||
}
|
||||
|
||||
const toggleDark = () => {
|
||||
setDarkMode(!darkMode)
|
||||
// localStorage.setItem(editorKey, JSON.stringify(!darkMode))
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
<div className="flex items-start justify-between gap-4 rounded-[5px_5px_0_0] px-4 py-3">
|
||||
@@ -384,13 +373,6 @@ export const EditorMenuBar = (properties: TProperties) => {
|
||||
>
|
||||
<ArrowUturnRightIcon />
|
||||
</EditorButton>
|
||||
<EditorButton
|
||||
onClick={() => toggleDark()}
|
||||
title={darkMode ? 'Switch to Light Mode' : 'Switch to Dark Mode'}
|
||||
isActive={true}
|
||||
>
|
||||
{darkMode ? <MoonIcon /> : <SunIcon />}
|
||||
</EditorButton>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
@@ -398,7 +380,6 @@ export const EditorMenuBar = (properties: TProperties) => {
|
||||
<EditorButton
|
||||
onClick={() => setIsPlainHTML(true)}
|
||||
title="Switch to Plain Text"
|
||||
isActive={true}
|
||||
>
|
||||
<DocumentTextIcon />
|
||||
</EditorButton>
|
||||
|
||||
Reference in New Issue
Block a user