We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ed2ef3c commit 92801f4Copy full SHA for 92801f4
src/components/ScrollToAnchors.jsx
@@ -7,7 +7,7 @@
7
* If there is any hash we check if component has element with such id and scroll to it.
8
*/
9
import React from 'react'
10
-import { SCROLL_TO_MARGIN, SCROLL_TO_DURATION } from '../config/constants'
+import { SCROLL_TO_MARGIN, SCROLL_TO_DURATION, SCREEN_BREAKPOINT_MD } from '../config/constants'
11
import { scroller } from 'react-scroll'
12
13
/**
@@ -24,7 +24,7 @@ export function scrollToHash(hash) {
24
scroller.scrollTo(id, {
25
spy: true,
26
smooth: true,
27
- offset: windowWidth < 768 ? 0 : -SCROLL_TO_MARGIN,
+ offset: windowWidth < SCREEN_BREAKPOINT_MD ? 0 : -SCROLL_TO_MARGIN,
28
duration: SCROLL_TO_DURATION,
29
activeClass: 'active'
30
})
0 commit comments