From 938db9bc7852a548ea6a2aecb6678672040b786a Mon Sep 17 00:00:00 2001 From: Tvisha Date: Fri, 6 Dec 2024 18:08:07 +0530 Subject: [PATCH] cta changes plus alignment (#152) * cta changes plus alignment * few fixes --------- Co-authored-by: Tvisha Raji Co-authored-by: Animesh Pathak <53110238+Sonichigo@users.noreply.github.com> --- components/hero.tsx | 26 +++++++++++++++++++++----- components/ui/banner.tsx | 4 ++-- components/ui/header.tsx | 16 ++++++++-------- components/ui/mobile-menu.tsx | 4 ++-- 4 files changed, 33 insertions(+), 17 deletions(-) diff --git a/components/hero.tsx b/components/hero.tsx index a3d57477..17d042bc 100644 --- a/components/hero.tsx +++ b/components/hero.tsx @@ -4,7 +4,7 @@ import VideoThumb from '@/public/images/demo-thumbnail.png'; import ModalVideo from '@/components/modal-video'; import Image from "next/image"; import TestimonialImage from "@/public/images/users/Nutanix_Logo.svg"; -import React from "react"; +import React, { useEffect, useState } from "react"; import CopyButton from './utils/copyButton'; import { TrustedBy } from './trustedBy'; import Link from 'next/link'; @@ -12,6 +12,21 @@ import APItext from "@/public/images/apiText.png"; import Banner from './ui/banner'; export default function Hero() { + const [isMobile, setIsMobile] = useState(false); + + // Detect screen size on component mount and update state + useEffect(() => { + const handleResize = () => { + setIsMobile(window.innerWidth <= 1038); // Adjust this breakpoint as needed + }; + + handleResize(); // Check on mount + window.addEventListener("resize", handleResize); + + // Cleanup listener on component unmount + return () => window.removeEventListener("resize", handleResize); + }, []); + return (
@@ -92,9 +107,10 @@ export default function Hero() { data-aos-delay="300">
{/* Wrapping Link with NeonButton */} - Try VS Code Extension @@ -103,9 +119,9 @@ export default function Hero() { {/* Wrapping Link with NeonButton */} - Sign In to Keploy Console + Explore Open Source Now
diff --git a/components/ui/banner.tsx b/components/ui/banner.tsx index 57b7ffd0..3f4f3dcc 100644 --- a/components/ui/banner.tsx +++ b/components/ui/banner.tsx @@ -4,7 +4,7 @@ import React, { useState } from "react"; import { FiX } from "react-icons/fi"; const Banner = () => { - const [showBanner, setShowBanner] = useState(true); + const [showBanner, setShowBanner] = useState(false); if (!showBanner) return null; @@ -61,4 +61,4 @@ const Banner = () => { ); }; -export default Banner; +export default Banner; \ No newline at end of file diff --git a/components/ui/header.tsx b/components/ui/header.tsx index 9d483196..105a7d0b 100644 --- a/components/ui/header.tsx +++ b/components/ui/header.tsx @@ -69,33 +69,33 @@ export default function Header() {
{/* Site branding */} -
+
{/* Desktop navigation */} -