@@ -4,6 +4,7 @@ import { ReactComponent as IntegrationsImage } from "./images/integration-image-
4
4
import UnderlineImg from "./images/underline.svg" ;
5
5
import { useInView } from "react-intersection-observer" ;
6
6
import { useState } from "react" ;
7
+ import { useStaticQuery , graphql } from "gatsby" ;
7
8
// import { useStyledDarkMode } from "../../../theme/app/useStyledDarkMode";
8
9
9
10
const IntegrationsSectionWrapper = styled . div `
@@ -97,10 +98,20 @@ const MeshmapIntegrationsSection = () => {
97
98
const [ diagramRef , inView ] = useInView ( { threshold : 0.6 } ) ;
98
99
const [ imageInView , setimageInView ] = useState ( false ) ;
99
100
100
- if ( inView && ! imageInView )
101
- setimageInView ( true ) ;
102
- else if ( imageInView && ! inView )
103
- setimageInView ( false ) ;
101
+ const integrations = useStaticQuery ( graphql `
102
+ query {
103
+ allMdx(
104
+ filter: {
105
+ fields: { collection: { eq: "integrations" } }
106
+ frontmatter: { published: { eq: true } }
107
+ }
108
+ ) {
109
+ totalCount
110
+ }
111
+ }
112
+ ` ) ;
113
+ if ( inView && ! imageInView ) setimageInView ( true ) ;
114
+ else if ( imageInView && ! inView ) setimageInView ( false ) ;
104
115
105
116
// const { isDark } = useStyledDarkMode();
106
117
@@ -110,7 +121,7 @@ const MeshmapIntegrationsSection = () => {
110
121
< IntegrationsImage alt = "integrations-img" className = { imageInView ? "diagram-visible" : "diagram-hidden" } />
111
122
</ div >
112
123
< div className = "hero-text" >
113
- < h1 > 220 + Built-in Integrations</ h1 >
124
+ < h1 > { Math . ceil ( integrations . allMdx . totalCount / 10 ) * 10 } + Built-in Integrations</ h1 >
114
125
< img className = "underline-img" src = { UnderlineImg } />
115
126
< h4 > Support for all of your Cloud Native Infrastructure and Applications.</ h4 >
116
127
</ div >
0 commit comments