Skip to content

Commit

Permalink
Add Header and Title components
Browse files Browse the repository at this point in the history
  • Loading branch information
travismiller committed Feb 12, 2021
1 parent ea9632d commit c874e25
Show file tree
Hide file tree
Showing 5 changed files with 59 additions and 18 deletions.
23 changes: 23 additions & 0 deletions src/components/header.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import logo from '@/images/logo.png'

export default function Header({ children }) {
return (
<>
<header className="; flex">
<img className="; block h-32 w-auto" src={logo} alt="Logo" />

<div className="flex space-x-4">
{/* <!-- Current: "bg-gray-900 text-white", Default: "text-gray-300 hover:bg-gray-700 hover:text-white" --> */}
<a href="#">Home</a>
<a href="#">About Us</a>
<a href="#">News</a>
<a href="#">Dues</a>
<a href="#">Events</a>
<a href="#">Contact</a>
<a href="#">Gallery</a>
<a href="#">History</a>
</div>
</header>
</>
)
}
11 changes: 5 additions & 6 deletions src/components/layout.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import logo from '@/images/logo.png'
import Header from '@/components/header'

export default function Layout({ children }) {
return (
<>
<header>
<img src={logo} alt="Logo" />
</header>
<div className="; lg:container mx-auto">
<Header />

{children}
</>
</div>
)
}
9 changes: 9 additions & 0 deletions src/components/title.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import Head from 'next/head'

export default function Title({ children }) {
return (
<Head>
<title>{children}{children && ' | '}Renaissance Neighborhood Association, Tulsa, OK</title>
</Head>
)
}
18 changes: 16 additions & 2 deletions src/pages/_app.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
import '@/styles/globals.css'
// import 'tailwindcss/tailwind.css'
import Title from '@/components/title'
import Head from 'next/head'
import Layout from '@/components/layout'

function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
return (
<>
<Title />

<Head>
<link rel="icon" href={`${process.env.BASE_PATH || ''}/favicon.ico`} />
</Head>

<Layout>
<Component {...pageProps} />
</Layout>
</>
)
}

export default MyApp
16 changes: 6 additions & 10 deletions src/pages/index.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import Head from 'next/head'
import styles from '@/styles/Home.module.css'
import Layout from '@/components/layout'
import Title from '@/components/title'

export default function Home() {
return (
<Layout>
<Head>
<title>Create Next App</title>
<link rel="icon" href={`${process.env.BASE_PATH || ''}/favicon.ico`} />
</Head>
return <>
<Title>Home</Title>

<div>
<main className={styles.main}>
<h1 className={styles.title}>
Welcome to <a href="https://nextjs.org">Next.js!</a>
Expand Down Expand Up @@ -61,6 +57,6 @@ export default function Home() {
<img src="/vercel.svg" alt="Vercel Logo" className={styles.logo} />
</a>
</footer>
</Layout>
)
</div>
</>
}

0 comments on commit c874e25

Please sign in to comment.