mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-11-12 13:13:45 +01:00
toggleSymbolPalette now in useEditorPropertiesContext
This commit is contained in:
+2
-2
@@ -1,9 +1,9 @@
|
|||||||
import { useEditorContext } from '../../../shared/context/editor-context'
|
import { useEditorPropertiesContext } from '@/features/ide-react/context/editor-properties-context'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
|
|
||||||
export default function SymbolPaletteCloseButton() {
|
export default function SymbolPaletteCloseButton() {
|
||||||
const { toggleSymbolPalette } = useEditorContext()
|
const { toggleSymbolPalette } = useEditorPropertiesContext()
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
|
|
||||||
const handleClick = () => {
|
const handleClick = () => {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import { useCallback, useEffect, useRef, useState } from 'react'
|
import { useCallback, useEffect, useRef, useState } from 'react'
|
||||||
import PropTypes from 'prop-types'
|
import PropTypes from 'prop-types'
|
||||||
import { useEditorContext } from '../../../shared/context/editor-context'
|
import { useEditorPropertiesContext } from '@/features/ide-react/context/editor-properties-context'
|
||||||
import SymbolPaletteItem from './symbol-palette-item'
|
import SymbolPaletteItem from './symbol-palette-item'
|
||||||
|
|
||||||
export default function SymbolPaletteItems({
|
export default function SymbolPaletteItems({
|
||||||
@@ -19,7 +19,7 @@ export default function SymbolPaletteItems({
|
|||||||
const getItemRects = () => {
|
const getItemRects = () => {
|
||||||
return itemRefs.current.map(ref => ref?.getBoundingClientRect?.() ?? null)
|
return itemRefs.current.map(ref => ref?.getBoundingClientRect?.() ?? null)
|
||||||
}
|
}
|
||||||
const { toggleSymbolPalette } = useEditorContext()
|
const { toggleSymbolPalette } = useEditorPropertiesContext()
|
||||||
|
|
||||||
const handleKeyDown = useCallback(
|
const handleKeyDown = useCallback(
|
||||||
event => {
|
event => {
|
||||||
|
|||||||
Reference in New Issue
Block a user