Commit cfe52006 authored by David Rhoderick's avatar David Rhoderick
Browse files

Latest version of initial commit with pages and routing set up.

parent 71832ca0
Pipeline #17 canceled with stages
......@@ -32,3 +32,6 @@ yarn-error.log*
# vercel
.vercel
# vscode
.vscode
\ No newline at end of file
import NavLink from './navlink'
import styles from './navbar.module.scss'
export default function Navbar() {
return (
<ul>
<li><NavLink href="/"><a>work</a></NavLink></li>
<li><NavLink href="/about"><a>about me</a></NavLink></li>
<li><NavLink href="/contact"><a>contact</a></NavLink></li>
</ul>
)
}
\ No newline at end of file
import React from 'react'
import Link from 'next/link'
import { useRouter } from 'next/router'
import styles from './navlink.module.scss'
export default function NavLink ({ href, children }) {
const router = useRouter()
let className = children.props.className || ''
if (router.pathname === href) {
className = styles.active
}
return (<Link href={href}>{React.cloneElement(children, { className })}</Link>)
}
\ No newline at end of file
.active {
color: pink;
}
\ No newline at end of file
......@@ -10,6 +10,7 @@
"dependencies": {
"next": "10.0.7",
"react": "17.0.1",
"react-dom": "17.0.1"
"react-dom": "17.0.1",
"sass": "^1.32.8"
}
}
import '../styles/globals.css'
import '../styles/global.scss'
import Navbar from '../components/navbar'
function MyApp({ Component, pageProps }) {
return <Component {...pageProps} />
return <>
<Navbar />
<Component {...pageProps} />
</>
}
export default MyApp
import Head from 'next/head'
import styles from './about.module.scss'
export default function About() {
return (
<>
<Head>
<title>About</title>
</Head>
<h1 className={styles.heading}>About page</h1>
</>
)
}
.heading {
color: blue;
}
\ No newline at end of file
// Next.js API route support: https://nextjs.org/docs/api-routes/introduction
export default (req, res) => {
res.status(200).json({ name: 'John Doe' })
}
import Head from 'next/head'
export default function Contact() {
return (
<>
<Head>
<title>Contact</title>
</Head>
<h1>Contact page</h1>
</>
)
}
import Head from 'next/head'
import styles from '../styles/Home.module.css'
export default function Home() {
export default function Work() {
return (
<div className={styles.container}>
<>
<Head>
<title>Create Next App</title>
<link rel="icon" href="/favicon.ico" />
<title>Work</title>
</Head>
<main className={styles.main}>
<h1 className={styles.title}>
Welcome to <a href="https://nextjs.org">Next.js!</a>
</h1>
<p className={styles.description}>
Get started by editing{' '}
<code className={styles.code}>pages/index.js</code>
</p>
<div className={styles.grid}>
<a href="https://nextjs.org/docs" className={styles.card}>
<h3>Documentation &rarr;</h3>
<p>Find in-depth information about Next.js features and API.</p>
</a>
<a href="https://nextjs.org/learn" className={styles.card}>
<h3>Learn &rarr;</h3>
<p>Learn about Next.js in an interactive course with quizzes!</p>
</a>
<a
href="https://github.com/vercel/next.js/tree/master/examples"
className={styles.card}
>
<h3>Examples &rarr;</h3>
<p>Discover and deploy boilerplate example Next.js projects.</p>
</a>
<a
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
className={styles.card}
>
<h3>Deploy &rarr;</h3>
<p>
Instantly deploy your Next.js site to a public URL with Vercel.
</p>
</a>
</div>
</main>
<footer className={styles.footer}>
<a
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
target="_blank"
rel="noopener noreferrer"
>
Powered by{' '}
<img src="/vercel.svg" alt="Vercel Logo" className={styles.logo} />
</a>
</footer>
</div>
<h1>Work page</h1>
</>
)
}
.container {
min-height: 100vh;
padding: 0 0.5rem;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.main {
padding: 5rem 0;
flex: 1;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
}
.footer {
width: 100%;
height: 100px;
border-top: 1px solid #eaeaea;
display: flex;
justify-content: center;
align-items: center;
}
.footer img {
margin-left: 0.5rem;
}
.footer a {
display: flex;
justify-content: center;
align-items: center;
}
.title a {
color: #0070f3;
text-decoration: none;
}
.title a:hover,
.title a:focus,
.title a:active {
text-decoration: underline;
}
.title {
margin: 0;
line-height: 1.15;
font-size: 4rem;
}
.title,
.description {
text-align: center;
}
.description {
line-height: 1.5;
font-size: 1.5rem;
}
.code {
background: #fafafa;
border-radius: 5px;
padding: 0.75rem;
font-size: 1.1rem;
font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono,
Bitstream Vera Sans Mono, Courier New, monospace;
}
.grid {
display: flex;
align-items: center;
justify-content: center;
flex-wrap: wrap;
max-width: 800px;
margin-top: 3rem;
}
.card {
margin: 1rem;
flex-basis: 45%;
padding: 1.5rem;
text-align: left;
color: inherit;
text-decoration: none;
border: 1px solid #eaeaea;
border-radius: 10px;
transition: color 0.15s ease, border-color 0.15s ease;
}
.card:hover,
.card:focus,
.card:active {
color: #0070f3;
border-color: #0070f3;
}
.card h3 {
margin: 0 0 1rem 0;
font-size: 1.5rem;
}
.card p {
margin: 0;
font-size: 1.25rem;
line-height: 1.5;
}
.logo {
height: 1em;
}
@media (max-width: 600px) {
.grid {
width: 100%;
flex-direction: column;
}
}
body {
}
\ No newline at end of file
html,
body {
padding: 0;
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen,
Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif;
}
a {
color: inherit;
text-decoration: none;
}
* {
box-sizing: border-box;
}
......@@ -371,7 +371,7 @@ chalk@4.0.0:
ansi-styles "^4.1.0"
supports-color "^7.1.0"
chokidar@3.5.1:
chokidar@3.5.1, "chokidar@>=2.0.0 <4.0.0":
version "3.5.1"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.1.tgz#ee9ce7bbebd2b79f49f304799d5468e31e14e68a"
integrity sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==
......@@ -1509,6 +1509,13 @@ safe-buffer@~5.1.0, safe-buffer@~5.1.1:
resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
sass@^1.32.8:
version "1.32.8"
resolved "https://registry.yarnpkg.com/sass/-/sass-1.32.8.tgz#f16a9abd8dc530add8834e506878a2808c037bdc"
integrity sha512-Sl6mIeGpzjIUZqvKnKETfMf0iDAswD9TNlv13A7aAF3XZlRPMq4VvJWBC2N2DXbp94MQVdNSFG6LfF/iOXrPHQ==
dependencies:
chokidar ">=2.0.0 <4.0.0"
scheduler@^0.20.1:
version "0.20.1"
resolved "https://registry.yarnpkg.com/scheduler/-/scheduler-0.20.1.tgz#da0b907e24026b01181ecbc75efdc7f27b5a000c"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment