import React, {useRef, useState} from 'react' import Image from 'next/image' import backgroundPic from '../public/unspash_image.jpg' import { Inter } from 'next/font/google' import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { faChevronCircleUp } from "@fortawesome/free-solid-svg-icons"; import navigationContent from '../lib/navigationContent' import ContactForm from '@/components/form/ContactForm'; import Footer from '@/components/footer'; import Link from 'next/link'; const inter = Inter({ subsets: ['latin'] }) export default function Home() { const contactFormSectionRef = useRef(null); const landingSectionRef = useRef(null); const [contactClicked, setContactClicked] = useState(false); const customStyles = { overlay: { backgroundColor: 'rgba(0, 0, 0, 0.6)' }, content: { top: '50%', left: '50%', right: 'auto', bottom: 'auto', marginRight: '-50%', transform: 'translate(-50%, -50%)', backgroundColor: 'gray', width: '75vw' } } const [showModal, setShowModal] = useState(false); const [modalData, setModalData] = useState<{name: string, url: string, content?: string | React.JSX.Element | null}>({ name: '', url: '', content: '' }); const renderNav = (navData: Array<{name: string, url: string, content: (string | React.JSX.Element | null)}>) => { return navData.map((data, idx) => ( { setShowModal(true); setModalData(data); }} key={idx} className='p-4 border-white text-white border-2 hover:cursor-pointer hover:bg-white hover:bg-opacity-10' > {data.name} )).concat([ { setContactClicked(true); setTimeout(() => { executeScrollToContact(); }, 10); }} key={navData.length} className='p-4 border-white text-white border-2 hover:cursor-pointer hover:bg-white hover:bg-opacity-10' > CONTACT ]); }; const executeScrollToContact = () => contactFormSectionRef.current?.scrollIntoView({behavior: 'smooth'}); const executeScrollToLandiing = () => landingSectionRef.current?.scrollIntoView({behavior: 'smooth'}); return (
{!showModal &&
{/* record background */}

Okechi Onyeje

Software Professional | Application Artisan | Creative & Technology Evangilist
{renderNav(navigationContent)}
} {showModal && (
setShowModal(false)}>X
{modalData.content}
)}
{contactClicked &&
{ executeScrollToLandiing(); setTimeout(() => { setContactClicked(false); }, 10); }}>
}
) }