File tree Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Expand file tree Collapse file tree 1 file changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -41,16 +41,19 @@ export default function SDKsSection() {
41
41
const [ visibleSection , setVisibleSection ] = useState ( 'Web' ) ;
42
42
43
43
React . useEffect ( ( ) => {
44
- const observer = new IntersectionObserver ( ( entries ) => {
45
- for ( const entry of entries ) {
46
- const section = entry . target . getAttribute ( 'data-section' ) ;
44
+ const observer = new IntersectionObserver (
45
+ ( entries ) => {
46
+ for ( const entry of entries ) {
47
+ const section = entry . target . getAttribute ( 'data-section' ) ;
47
48
48
- if ( entry . isIntersecting ) {
49
- entry . target . classList . add ( 'intersected' ) ;
50
- setVisibleSection ( section ) ;
49
+ if ( entry . isIntersecting ) {
50
+ entry . target . classList . add ( 'intersected' ) ;
51
+ setVisibleSection ( section ) ;
52
+ }
51
53
}
52
- }
53
- } ) ;
54
+ } ,
55
+ { rootMargin : '-50% 0% -50% 0%' }
56
+ ) ;
54
57
55
58
const elements = document . querySelectorAll ( '.sdk-section' ) ;
56
59
for ( const el of elements ) {
You can’t perform that action at this time.
0 commit comments