Skip to content

Commit 940d3d3

Browse files
test no analitics
1 parent 6a42b33 commit 940d3d3

File tree

3 files changed

+18
-7
lines changed

3 files changed

+18
-7
lines changed

src/components/client-side/ScrollSlider/ScrollSlider.tsx

+13-2
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,8 @@ const ScrollSlider = ({ components, className, id }: Props) => {
3535
[activeIndex, triggers],
3636
);
3737

38-
useEffect(() => {
39-
if (!inView && mainRef.current) {
38+
const checkPosition = useCallback(() => {
39+
if (mainRef.current) {
4040
const rect = mainRef.current.getBoundingClientRect();
4141
if (rect.top + rect.height < window.scrollY) {
4242
setActive(components.length - 1);
@@ -45,9 +45,20 @@ const ScrollSlider = ({ components, className, id }: Props) => {
4545
setActive(0);
4646
}
4747
}
48+
}, [activeIndex, components.length]);
49+
50+
useEffect(() => {
51+
if (!inView && mainRef.current) {
52+
checkPosition();
53+
}
4854
// eslint-disable-next-line react-hooks/exhaustive-deps
4955
}, [inView]);
5056

57+
useEffect(() => {
58+
checkPosition();
59+
// eslint-disable-next-line react-hooks/exhaustive-deps
60+
}, []);
61+
5162
return (
5263
<div className={clsx("scroll-slider", className)} id={id} ref={mainRef}>
5364
<div className="floating">

src/layouts/BaseLayout.astro

+4-4
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import FloatingLinks from "../components/FloatingLinks.astro";
33
import Footer from "../components/base/Footer.astro";
44
import "../styles/global.scss";
55
import { CookieBar } from "../components/base/CookieBar/CookieBar";
6-
import Clarity from "../components/analytics/Clarity.astro";
7-
import Google from "../components/analytics/Google.astro";
6+
// import Clarity from "../components/analytics/Clarity.astro";
7+
// import Google from "../components/analytics/Google.astro";
88
99
const favSizes = [
1010
16, 32, 57, 60, 70, 72, 76, 96, 114, 120, 128, 144, 150, 152, 180, 192, 310, 384, 512,
@@ -53,14 +53,14 @@ const { url, title, description, featuredImage, imageWidth, imageHeight } = Astr
5353
}
5454
<link rel="icon" type="image/ico" href="/favicon/favicon.ico" />
5555
<link rel="sitemap" href="/sitemap-index.xml" />
56-
<Google />
56+
<!-- <Google /> -->
5757
</head>
5858
<body>
5959
<slot />
6060
<Footer />
6161
<FloatingLinks />
6262
<CookieBar client:only="react" />
63-
<Clarity />
63+
<!-- <Clarity /> -->
6464
</body>
6565
</html>
6666

src/pages/index.astro

+1-1
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ const tags = [
7070
<HomeHeader />
7171
<HomeSection className="scroll-section" variant="white">
7272
<Fragment>
73-
<HomeScrollSection1 client:load />
73+
<HomeScrollSection1 client:idle />
7474
</Fragment>
7575
</HomeSection>
7676
<FlexibleIdentitySection />

0 commit comments

Comments
 (0)