diff --git a/src/components/topmate/TopMateCard.tsx b/src/components/topmate/TopMateCard.tsx index 1bc69696..772c1aca 100644 --- a/src/components/topmate/TopMateCard.tsx +++ b/src/components/topmate/TopMateCard.tsx @@ -1,7 +1,7 @@ -import React from 'react'; -import { motion } from 'framer-motion'; -import { ArrowUpRight, Clock } from 'lucide-react'; -import { useColorMode } from '@docusaurus/theme-common'; +import React from "react"; +import { motion } from "framer-motion"; +import { ArrowUpRight, Clock } from "lucide-react"; +import { useColorMode } from "@docusaurus/theme-common"; interface TopMateCardProps { title: string; @@ -9,6 +9,7 @@ interface TopMateCardProps { duration: string; profileImage: string; username: string; + setShowTopmate: (value: boolean) => void; } const TopMateCard: React.FC = ({ @@ -17,9 +18,10 @@ const TopMateCard: React.FC = ({ duration, profileImage, username, + setShowTopmate, }) => { const { colorMode } = useColorMode(); - const isDark = colorMode === 'dark'; + const isDark = colorMode === "dark"; return ( = ({ animate={{ opacity: 1, y: 0 }} transition={{ duration: 0.5 }} className={`relative w-full max-w-md mx-auto rounded-3xl shadow-2xl overflow-hidden hover:shadow-3xl transition-all duration-300 transform hover:-translate-y-1 ${ - isDark ? 'bg-[#1a1a1a] text-white' : 'bg-white text-black' + isDark ? "bg-[#1a1a1a] text-white" : "bg-white text-black" }`} > {/* Decorative Arrows */} @@ -50,28 +52,47 @@ const TopMateCard: React.FC = ({ {/* Header */}
- + 1:1 CALL -
+
{duration}
{/* Title */} -

+

{title}

{/* Description */} -

{description}

+

+ {description} +

{/* Profile Section */}
@@ -82,7 +103,11 @@ const TopMateCard: React.FC = ({ className="w-12 h-12 rounded-full object-cover border-2 border-purple-200" />
- + Book a slot at = ({ />
{/* Theme-aware text to ensure readability on dark backgrounds */} - topmate + + topmate +
diff --git a/src/components/topmate/TopMateSection.tsx b/src/components/topmate/TopMateSection.tsx index eabc0a71..8a42e1ba 100644 --- a/src/components/topmate/TopMateSection.tsx +++ b/src/components/topmate/TopMateSection.tsx @@ -1,8 +1,8 @@ -import React from 'react'; -import TopMateCard from './TopMateCard'; -import { useColorMode } from '@docusaurus/theme-common'; +import React from "react"; +import TopMateCard from "./TopMateCard"; +import { useColorMode } from "@docusaurus/theme-common"; -const TopMateSection = () => { +const TopMateSection = ({ setShowTopmate }) => { const { colorMode } = useColorMode(); // Get current theme: 'light' or 'dark' const profileData = { @@ -10,7 +10,7 @@ const TopMateSection = () => { description: "Book a slot, Free for Hive Community Members", duration: "30 mins", profileImage: "/sanjay.png", - username: "sanjaykv" + username: "sanjaykv", }; return ( @@ -19,14 +19,14 @@ const TopMateSection = () => {

Book a Session

Get personalized guidance and feedback through one-on-one sessions @@ -34,7 +34,7 @@ const TopMateSection = () => {

- +
diff --git a/src/pages/index.tsx b/src/pages/index.tsx index fab42a62..12665676 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from "react"; +import React, { useEffect, useState } from "react"; import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; import Layout from "@theme/Layout"; import type { ReactNode } from "react"; @@ -18,23 +18,25 @@ import FAQs from "../components/faqs/faqs"; export default function Home(): ReactNode { const { siteConfig } = useDocusaurusContext(); - + const [showTopmate, setShowTopmate] = useState(true); + useEffect(() => { // Add page transition animation on mount - const mainElement = document.querySelector('main'); + const mainElement = document.querySelector("main"); if (mainElement) { - mainElement.style.opacity = '0'; - mainElement.style.transform = 'translateY(20px)'; - mainElement.style.transition = 'opacity 0.6s ease-out, transform 0.6s ease-out'; - + mainElement.style.opacity = "0"; + mainElement.style.transform = "translateY(20px)"; + mainElement.style.transition = + "opacity 0.6s ease-out, transform 0.6s ease-out"; + // Trigger animation after a brief delay setTimeout(() => { - mainElement.style.opacity = '1'; - mainElement.style.transform = 'translateY(0)'; + mainElement.style.opacity = "1"; + mainElement.style.transform = "translateY(0)"; }, 100); } }, []); - + return ( {/* ✅ Wrap in solid background to fix light mode */} -
-
-
+
+
+
@@ -75,10 +89,12 @@ export default function Home(): ReactNode {
-
- -
-
+ {showTopmate && ( +
+ +
+ )} +