/* eslint-disable no-unused-vars */ /* eslint-disable react/prop-types */ import { Box, Container, Image, Text } from "@chakra-ui/react"; import cube from "../../assets/images/cube.png"; import { Fade, ScaleFade, Slide, SlideFade, Collapse } from "@chakra-ui/react"; import { useEffect, useState } from "react"; import { SubnetPage3 } from "./SubnetPage3"; export const SubnetPage2 = () => { const [showSubnet, setShowSubnet] = useState(1); // const [showSubnet3, setShowSubnet3] = useState(false); // const [showStickyPosition, setShowStickyPosition] = useState(false); // useEffect(() => { // const handleScroll = () => { // const threshold = 400; // Adjust this threshold according to your design // if (window.scrollY > threshold && !showSubnet3) { // setShowStickyPosition(true); // } // }; // window.addEventListener("scroll", handleScroll); // return () => { // window.removeEventListener("scroll", handleScroll); // }; // }, [showSubnet3]); // useEffect(() => { // if (showStickyPosition) { // setShowSubnet3(true); // } // }, [showStickyPosition]); useEffect(() => { const handleScroll = () => { const threshold1 = 400; // Threshold to switch to SubnetPage2 const threshold2 = 700; // Threshold to switch to SubnetPage3 if (window.scrollY > threshold2 && showSubnet < 2) { setShowSubnet(2); } else if (window.scrollY > threshold1 && showSubnet < 1) { setShowSubnet(1); } }; window.addEventListener("scroll", handleScroll); return () => { window.removeEventListener("scroll", handleScroll); }; }, [showSubnet]); return ( <> {showSubnet === 1 && ( With Unmatched Privacy and Scalability 01. Decentralisation Rubix Decentralised Identity(DID) issued at L1 is the foundation for building digital ownership enhancing applications 01. Decentralisation Rubix Decentralised Identity(DID) issued at L1 is the foundation for building digital ownership enhancing applications 01. Decentralisation Rubix Decentralised Identity(DID) issued at L1 is the foundation for building digital ownership enhancing applications )} {showSubnet === 2 && } ); };