Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove code block from Keploy developer section in keploy website landing page #27

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
58 changes: 0 additions & 58 deletions components/features.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ const TestAndStubGenerationImage = () => {
<div className=" mb-2 h-[50%]">
<LottiePlayer VideoPath={testAndStubsGen} />
</div>
<CopyCode />
</div>
);
};
Expand All @@ -41,68 +40,11 @@ const TestDuplicationImage = () => {
{/* <Image className="mx-auto rounded md:max-w-none" src={FeaturesBg} width={500} height="462" alt="Features bg" /> */}
{/*<Image className="absolute left-0 w-full transform md:max-w-none animate-float" src={FeaturesElement} width={500} height="44" alt="Element" style={{ top: '30%' }} />*/}
<LottiePlayer VideoPath={deDuplication} className="h-[60vh]" />
<CopyCode />
</div>
);
};

const CopyCode = () => {
const codeRef = useRef<HTMLDivElement>(null);

const copyButtonRef = useRef<HTMLButtonElement>(null);
// const heightFix = () => {
// if (tabs.current && tabs.current.parentElement)
// tabs.current.parentElement.style.height = `${tabs.current.clientHeight}px`;
// };
useEffect(() => {
// heightFix();

const clipboard = new ClipboardJS(copyButtonRef.current!, {
target: () => codeRef.current!,
});

clipboard.on("success", (e) => {
// You can customize the success behavior here (e.g., show a notification).
console.log("Copied to clipboard:", e.text);
});

return () => {
clipboard.destroy();
};
}, []);

return (
<>
<div
ref={codeRef}
className="bottom-0 flex items-center w-full mb-8 overflow-hidden text-left md:mb-0 animate-float"
>
<div className="flex-grow w-7/12 p-3 bg-gray-900 rounded-md overflow-clip">
<pre className="w-11/12 text-xs text-green-300 truncate md:text-sm lg:text-base">
<code>
$ curl -O
https://raw.githubusercontent.com/keploy/keploy/main/keploy.sh &&
source keploy.sh
</code>
</pre>
</div>
<div className="absolute right-3 bottom-2">
<button
ref={copyButtonRef}
onClick={() =>
navigator.clipboard.writeText(
"curl -O https://raw.githubusercontent.com/keploy/keploy/main/keploy.sh && source keploy.sh"
)
}
className="ml-2"
>
<Image src={CopyButton} alt="Copy" className="w-6 h-6" />
</button>
</div>
</div>
</>
);
};

const TextSection = ({
svg,
Expand Down