Hide table of contents on mobile

This commit is contained in:
kvakazyambra 2023-09-21 23:04:23 +03:00
parent 7c67ce977e
commit ea29b3b87f

View File

@ -10,6 +10,7 @@ import debounce from 'debounce'
import { Icon } from '../_shared/Icon'
import styles from './TableOfContents.module.scss'
import { isDesktop } from '../../utils/media-query'
interface Props {
variant: 'article' | 'editor'
@ -38,6 +39,8 @@ export const TableOfContents = (props: Props) => {
setIsVisible((visible) => !visible)
}
setIsVisible(isDesktop())
const updateHeadings = () => {
const { parentSelector } = props