Hide table of contents on mobile
This commit is contained in:
parent
7c67ce977e
commit
ea29b3b87f
|
@ -10,6 +10,7 @@ import debounce from 'debounce'
|
||||||
import { Icon } from '../_shared/Icon'
|
import { Icon } from '../_shared/Icon'
|
||||||
|
|
||||||
import styles from './TableOfContents.module.scss'
|
import styles from './TableOfContents.module.scss'
|
||||||
|
import { isDesktop } from '../../utils/media-query'
|
||||||
|
|
||||||
interface Props {
|
interface Props {
|
||||||
variant: 'article' | 'editor'
|
variant: 'article' | 'editor'
|
||||||
|
@ -38,6 +39,8 @@ export const TableOfContents = (props: Props) => {
|
||||||
setIsVisible((visible) => !visible)
|
setIsVisible((visible) => !visible)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setIsVisible(isDesktop())
|
||||||
|
|
||||||
const updateHeadings = () => {
|
const updateHeadings = () => {
|
||||||
const { parentSelector } = props
|
const { parentSelector } = props
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user