import {
Container,
SimpleGrid,
Image,
Flex,
Heading,
Text,
Stack,
StackDivider,
Icon,
useColorModeValue,
Button,
useBreakpointValue,
} from "@chakra-ui/react";
import React, { useContext } from "react";
import UIContext from "../core/providers/UIProvider/context";
import { FaGithubSquare } from "react-icons/fa";
import RouteButton from "../components/RouteButton";
const Feature = ({ text, icon, iconBg, bullets }) => {
return (
{icon}
{text}
{bullets?.length > 0 && (
{bullets.map((bullet, idx) => {
return (
}
/>
);
})}
)}
);
};
const SplitWithImage = ({
badge,
title,
body,
bullets,
colorScheme,
imgURL,
mirror,
elementName,
cta,
socialButton,
}) => {
var buttonSize = useBreakpointValue({
base: { single: "sm", double: "xs" },
sm: { single: "md", double: "sm" },
md: { single: "md", double: "sm" },
lg: { single: "lg", double: "lg" },
xl: { single: "lg", double: "lg" },
"2xl": { single: "lg", double: "lg" },
});
//idk why but sometimes buttonSize gets undefined
if (!buttonSize) buttonSize = "lg";
const ui = useContext(UIContext);
const [isVisible, setVisible] = React.useState(true);
const domRef = React.useRef();
React.useEffect(() => {
const observer = new IntersectionObserver((entries) => {
entries.forEach((entry) => setVisible(entry.isIntersecting));
});
observer.observe(domRef.current);
const current = domRef.current;
return () => observer.unobserve(current);
}, []);
return (
{mirror && !ui.isMobileView && (
)}
{badge}
{title}
{body}
}
>
{bullets?.map((bullet, idx) => {
return (
}
iconBg={bullet.bgColor}
text={bullet.text}
bullets={bullet?.bullets}
/>
);
})}
{socialButton && (
}
>
git clone moonstream
)}
{(!mirror || ui.isMobileView) && (
)}
);
};
export default SplitWithImage;