Skip to content

Commit 9e0f2f7

Browse files
authored
Merge pull request #4677 from saaagarsingh/meshmap-integration-count
Integration Count on meshmap design page updated.
2 parents da638cb + 4298751 commit 9e0f2f7

File tree

1 file changed

+16
-5
lines changed

1 file changed

+16
-5
lines changed

src/sections/Meshmap/Meshmap-design/meshmap-design-integrations.js

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { ReactComponent as IntegrationsImage } from "./images/integration-image-
44
import UnderlineImg from "./images/underline.svg";
55
import { useInView } from "react-intersection-observer";
66
import { useState } from "react";
7+
import { useStaticQuery, graphql } from "gatsby";
78
// import { useStyledDarkMode } from "../../../theme/app/useStyledDarkMode";
89

910
const IntegrationsSectionWrapper = styled.div`
@@ -97,10 +98,20 @@ const MeshmapIntegrationsSection = () => {
9798
const [diagramRef, inView] = useInView({ threshold: 0.6 });
9899
const [imageInView, setimageInView] = useState(false);
99100

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);
104115

105116
// const { isDark } = useStyledDarkMode();
106117

@@ -110,7 +121,7 @@ const MeshmapIntegrationsSection = () => {
110121
<IntegrationsImage alt="integrations-img" className={imageInView ? "diagram-visible" : "diagram-hidden"} />
111122
</div>
112123
<div className="hero-text">
113-
<h1>220+ Built-in Integrations</h1>
124+
<h1>{Math.ceil(integrations.allMdx.totalCount / 10) * 10}+ Built-in Integrations</h1>
114125
<img className="underline-img" src={UnderlineImg}/>
115126
<h4>Support for all of your Cloud Native Infrastructure and Applications.</h4>
116127
</div>

0 commit comments

Comments
 (0)