mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-31 02:00:07 +02:00
29 lines
788 B
JavaScript
29 lines
788 B
JavaScript
import { useEditorPropertiesContext } from '@/features/ide-react/context/editor-properties-context'
|
|
import { useTranslation } from 'react-i18next'
|
|
import PropTypes from 'prop-types'
|
|
|
|
export default function SymbolPaletteCloseButton() {
|
|
const { toggleSymbolPalette } = useEditorPropertiesContext()
|
|
const { t } = useTranslation()
|
|
|
|
const handleClick = () => {
|
|
toggleSymbolPalette()
|
|
window.dispatchEvent(new CustomEvent('editor:focus'))
|
|
}
|
|
|
|
return (
|
|
<div className="symbol-palette-close-button-outer">
|
|
<button
|
|
type="button"
|
|
className="btn-close symbol-palette-close-button"
|
|
onClick={handleClick}
|
|
aria-label={t('close')}
|
|
>
|
|
</button>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
SymbolPaletteCloseButton.propTypes = {
|
|
focusInput: PropTypes.func,
|
|
}
|