From 62ecb064225fcb6670385ccacba8d08e98491a72 Mon Sep 17 00:00:00 2001 From: Taqi Tahmid Date: Fri, 11 Apr 2025 21:47:52 +0300 Subject: [PATCH] frontend: add tooltip component and replace tooltip with it --- frontend/src/components/Introduction.tsx | 6 ++-- frontend/src/components/Navbar.tsx | 37 ++++++++++-------------- frontend/src/components/Tooltip.tsx | 25 ++++++++++++++++ frontend/src/pages/Projects.tsx | 6 ++-- 4 files changed, 47 insertions(+), 27 deletions(-) create mode 100644 frontend/src/components/Tooltip.tsx diff --git a/frontend/src/components/Introduction.tsx b/frontend/src/components/Introduction.tsx index d0c8144..43006e2 100644 --- a/frontend/src/components/Introduction.tsx +++ b/frontend/src/components/Introduction.tsx @@ -1,5 +1,6 @@ import { Linkedin, Github, Award } from 'lucide-react' import { COLORS } from '../constants' +import { Tooltip } from './Tooltip' const Introduction = () => { const BoldStyle = 'text-blue-900 dark:text-blue-300 font-semibold' @@ -57,6 +58,7 @@ const Introduction = () => {
{socialLinks.map((link, index) => (
+ { > {link.icon} - - {link.label} - +
))}
diff --git a/frontend/src/components/Navbar.tsx b/frontend/src/components/Navbar.tsx index 4faef76..694e5de 100644 --- a/frontend/src/components/Navbar.tsx +++ b/frontend/src/components/Navbar.tsx @@ -1,6 +1,7 @@ import React, { useEffect, useState, useRef } from 'react' import { Menu, Sun, Moon, FileText, Mail, Check, Copy } from 'lucide-react' import { COLORS, EMAIL, RESUME } from '../constants' +import { Tooltip } from './Tooltip' interface NavProps { darkMode: boolean @@ -11,6 +12,7 @@ const Navbar: React.FC = ({ toggleDarkMode, darkMode }) => { const [copied, setCopied] = useState(false) const [isMenuOpen, setIsMenuOpen] = useState(false) const menuRef = useRef(null) + const copyText = copied ? 'Copied!' : 'Click to copy' const handleCopyEmail = async () => { try { @@ -49,12 +51,12 @@ const Navbar: React.FC = ({ toggleDarkMode, darkMode }) => { return (