|
| 1 | +"use client"; |
| 2 | + |
| 3 | +import React, { useState } from "react"; |
| 4 | +import { FiX } from "react-icons/fi"; |
| 5 | + |
| 6 | +const Banner = () => { |
| 7 | + const [showBanner, setShowBanner] = useState(true); |
| 8 | + |
| 9 | + if (!showBanner) return null; |
| 10 | + |
| 11 | + return ( |
| 12 | + <div className="fixed top-16 lg:top-20 left-0 right-0 z-50 flex flex-row lg:flex-row items-center justify-between bg-gradient-to-r from-secondary-300 to-secondary-100 py-2 px-2 sm:px-6 lg:py-0 shadow-lg shadow-gray-400"> |
| 13 | + |
| 14 | + {/* Banner Content */} |
| 15 | + <div className="flex flex-col sm:flex-row items-center gap-3 sm:gap-4 lg:gap-6 w-full lg:w-auto text-center lg:text-left"> |
| 16 | + {/* Logo and title */} |
| 17 | + <div className=" items-center gap-2 sm:gap-3 hidden lg:flex"> |
| 18 | + <div className="flex items-center p-1 sm:p-2"> |
| 19 | + <img |
| 20 | + src="https://cdn.jsdelivr.net/gh/devicons/devicon/icons/vscode/vscode-original.svg" |
| 21 | + alt="VS Code logo" |
| 22 | + className="h-10 w-10 sm:h-12 sm:w-12 bg-white rounded-full border-2 border-gray-200 shadow-xl" |
| 23 | + /> |
| 24 | + </div> |
| 25 | + <h2 className="font-bold text-white font-inter text-sm sm:text-base lg:text-xl "> |
| 26 | + Supercharge Your Development |
| 27 | + </h2> |
| 28 | + </div> |
| 29 | + |
| 30 | + {/* Divider for desktop view */} |
| 31 | + <div className="hidden lg:block border-l border-accent-500 h-10 opacity-80" /> |
| 32 | + |
| 33 | + {/* Description */} |
| 34 | + <p className="text-white opacity-90 text-xs sm:text-sm lg:text-base max-w-full lg:max-w-lg leading-snug sm:leading-tight"> |
| 35 | + Discover how the Keploy VS Code extension lets you easily record and |
| 36 | + replay test cases within your IDE. |
| 37 | + </p> |
| 38 | + </div> |
| 39 | + |
| 40 | + {/* Action buttons and close button */} |
| 41 | + <div className="flex flex-row sm:flex-row sm:items-center justify-center gap-1 sm:gap-3 lg:gap-4 sm:mt-0"> |
| 42 | + <a |
| 43 | + href="https://marketplace.visualstudio.com/items?itemName=Keploy.keployio" |
| 44 | + target="_blank" |
| 45 | + rel="noopener noreferrer" |
| 46 | + className="bg-primary-400 hover:bg-primary-500 text-neutral-100 font-inter rounded px-0 sm:px-2 ml-1 lg:px-6 py-1 lg:py-2 text-xs sm:text-sm lg:text-base text-center transition-all duration-200 shadow-md" |
| 47 | + > |
| 48 | + Get Started for Free |
| 49 | + </a> |
| 50 | + <button |
| 51 | + onClick={() => setShowBanner(false)} |
| 52 | + className="text-gray-300 hover:text-white font-semibold text-lg sm:text-xl lg:text-2xl cursor-pointer transition-transform transform hover:scale-110" |
| 53 | + aria-label="Close Banner" |
| 54 | + > |
| 55 | + <FiX /> |
| 56 | + </button> |
| 57 | + </div> |
| 58 | + </div> |
| 59 | + ); |
| 60 | +}; |
| 61 | + |
| 62 | +export default Banner; |
0 commit comments