|
| 1 | +import React from 'react'; |
| 2 | +import Logo from './Logo'; |
| 3 | +import { FaGithub } from 'react-icons/fa'; |
| 4 | +import { useState } from 'react'; |
| 5 | +const nav_items = [ |
| 6 | + { |
| 7 | + name: 'Home', |
| 8 | + path: '/' |
| 9 | + }, |
| 10 | + { |
| 11 | + name: 'About', |
| 12 | + path: '#features', |
| 13 | + }, |
| 14 | + { |
| 15 | + name: 'docs', |
| 16 | + path: '/docs', |
| 17 | + }, |
| 18 | + // { |
| 19 | + // name: 'FAQ', |
| 20 | + // path: '#faq', |
| 21 | + // } |
| 22 | +]; |
| 23 | + |
| 24 | + |
| 25 | +export default function Navbar(props) { |
| 26 | + const [isOpen, setIsOpen] = useState(''); |
| 27 | + |
| 28 | + const toggle = () => { |
| 29 | + setIsOpen(isOpen === '' ? 'hidden' : ''); |
| 30 | + } |
| 31 | + return ( |
| 32 | + <nav className=" px-2 sm:px-4 py-2.5 text-white"> |
| 33 | + <div className="container flex flex-wrap justify-between items-center mx-auto"> |
| 34 | + <a href="https://seam.money" className="flex items-center"> |
| 35 | + <Logo/> |
| 36 | + </a> |
| 37 | + <button data-collapse-toggle="mobile-menu" type="button" onClick={() => toggle()} className="inline-flex items-center p-2 ml-3 text-sm text-gray-500 rounded-lg md:hidden hover:bg-gray-100 focus:outline-none focus:ring-2 focus:ring-gray-200 dark:text-gray-400 dark:hover:bg-gray-700 dark:focus:ring-gray-600" aria-controls="mobile-menu" aria-expanded="false"> |
| 38 | + <span className="sr-only">Open main menu</span> |
| 39 | + <svg className="w-6 h-6" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M3 5a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 10a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1zM3 15a1 1 0 011-1h12a1 1 0 110 2H4a1 1 0 01-1-1z" clip-rule="evenodd"></path></svg> |
| 40 | + <svg className="hidden w-6 h-6" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg> |
| 41 | + </button> |
| 42 | + <div className={`${isOpen} w-full md:block md:w-auto items-center`} id="mobile-menu"> |
| 43 | + <ul className="flex flex-col items-center mt-4 md:flex-row md:space-x-8 md:mt-0 md:text-sm md:font-medium"> |
| 44 | + |
| 45 | + {nav_items.map((item, i) => ( |
| 46 | + <li className='block py-2 pr-4 pl-3 text-white hover:bg-white hover:text-blac rounded-lg' > |
| 47 | + <a href={item.path} className=" ">{item.name}</a> |
| 48 | + </li> |
| 49 | + ))} |
| 50 | + <h3> |
| 51 | + <p className="text-white text-3xl p-2 m-3 rounded-xl hover:bg-white hover:text-blac "> |
| 52 | + <FaGithub className=" hover:text-blac " /> |
| 53 | + </p> |
| 54 | + </h3> |
| 55 | + <a href="app"> |
| 56 | + <button className='bg-transparent m-2 hover:bg-white font-semibold outline outline-2 hover:text-blac text-white py-2 px-4 rounded-2xl'> |
| 57 | + Launch app |
| 58 | + </button> |
| 59 | + </a> |
| 60 | + </ul> |
| 61 | + </div> |
| 62 | + </div> |
| 63 | + </nav> |
| 64 | + ); |
| 65 | +} |
0 commit comments