diff options
Diffstat (limited to 'app/components')
| -rw-r--r-- | app/components/Header.js | 12 | ||||
| -rw-r--r-- | app/components/Navbar.js | 46 | ||||
| -rw-r--r-- | app/components/PSA.js | 47 | ||||
| -rw-r--r-- | app/components/psa.json | 5 |
4 files changed, 110 insertions, 0 deletions
diff --git a/app/components/Header.js b/app/components/Header.js new file mode 100644 index 0000000..bd70dd0 --- /dev/null +++ b/app/components/Header.js @@ -0,0 +1,12 @@ +const Header = ({title, description}) => { + return ( + <div className="bg-center bg-no-repeat bg-[url('/jumbotron.webp')] bg-gray-700 bg-blend-multiply"> + <div className="md:px-40 px-10 max-w-screen-xl text-left py-24 lg:py-10 space-y-3"> + <h1 className="font-medium text-4xl">{title}</h1> + <h2 className="font-light text-lg">{description}</h2> + </div> + </div> + ) +} + +export default Header; diff --git a/app/components/Navbar.js b/app/components/Navbar.js new file mode 100644 index 0000000..1555eb9 --- /dev/null +++ b/app/components/Navbar.js @@ -0,0 +1,46 @@ +"use client"; +import Image from "next/image"; +import Link from "next/link"; +import { useState } from "react"; + +const Navbar = () => { + const [navbar, setNavbar] = useState(false); + return ( + <nav className="border-gray-200 bg-neutral-900"> + <div className="max-w-screen-xl flex flex-wrap items-center justify-between mx-auto p-4"> + <div className="flex items-center"> + <Image src="/alure_flag.svg" className="mr-5" alt="Alure Flag" width={70} height={70}/> + <span className="self-center text-2xl font-medium whitespace-nowrap dark:text-white"><p>Government</p><p>of Alure Regions</p></span> + </div> + <button data-collapse-toggle="navbar-default" type="button" + className="transition duration-150 ease-out hover:ease-in inline-flex items-center p-2 w-10 h-10 justify-center text-sm text-gray-500 rounded-lg md:hidden hover:bg-zinc-600 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="navbar-default" aria-expanded="false" onClick={() => setNavbar(!navbar)}> + <span className="sr-only">Open main menu</span> + <svg className="w-5 h-5" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" fill="none" + viewBox="0 0 17 14"> + <path stroke="currentColor" strokeLinecap="round" strokeLinejoin="round" strokeWidth="2" + d="M1 1h15M1 7h15M1 13h15"/> + </svg> + </button> + <div className={`w-full md:block md:w-auto ${navbar ? 'block' : 'hidden' }`}> + <ul className="font-medium text-lg flex flex-col p-4 md:p-0 mt-4 rounded-lg md:flex-row md:space-x-8 md:mt-0"> + {[ + ['Home', '/'], + ['Updates', '/updates'], + ['Services', '/services'], + ['Travel Advisory', '/travel-advisory'], + ].map(([title, url]) => ( + <li key="links"> + <Link href={url} className="transition duration-150 ease-out hover:ease-in block py-2 pl-3 pr-4 rounded md:border-0 md:p-0 text-white md:hover:text-blue-500 hover:bg-gray-700 hover:text-white md:hover:bg-transparent" onClick={() => setNavbar(!navbar)}> + {title} + </Link> + </li> + ))} + </ul> + </div> + </div> + </nav> + ) +} + +export default Navbar; diff --git a/app/components/PSA.js b/app/components/PSA.js new file mode 100644 index 0000000..06bf9ba --- /dev/null +++ b/app/components/PSA.js @@ -0,0 +1,47 @@ +import psaMessage from './psa.json' assert { type: 'json' }; +import Link from "next/link"; + +const PSA = () => { + let defaultStyle = "flex flex-row md:px-40 px-30 py-0.5 space-x-2"; + let styleImportant; + let important; + switch (psaMessage.important) { + case 0: + styleImportant = "hidden" + defaultStyle += ' ' + styleImportant + break; + case 1: + important = "Latest News:" + styleImportant = "bg-zinc-700" + defaultStyle += ' ' + styleImportant + break; + case 2: + important = "WARNING!" + styleImportant = "bg-yellow-700" + defaultStyle += ' ' + styleImportant + break; + case 3: + important = "EMERGENCY!" + styleImportant = "bg-red-800" + defaultStyle += ' ' + styleImportant + break; + + } + + return ( + <div className={defaultStyle}> + <p className="text-lg font-medium">{important}</p> + <div className="flex flex-row space-x-3"> + <p>{psaMessage.announcement}</p> + <p className="text-blue-200 hover:text-blue-500 active:text-blue-700"> + {psaMessage.link && ( + <Link href={psaMessage.link}> + Learn more ↗ + </Link> + )}</p> + </div> + </div> + ) +} + +export default PSA; diff --git a/app/components/psa.json b/app/components/psa.json new file mode 100644 index 0000000..df9869f --- /dev/null +++ b/app/components/psa.json @@ -0,0 +1,5 @@ +{ + "important": 0, + "announcement": "No important announcements", + "link": "https://google.ca" +} |
