Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 43aeb98

Browse files
project started.
0 parents commit 43aeb98

File tree

6 files changed

+5837
-0
lines changed

6 files changed

+5837
-0
lines changed

‎.gitignore‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.js
7+
8+
# testing
9+
/coverage
10+
11+
# next.js
12+
/.next/
13+
/out/
14+
15+
# production
16+
/build
17+
18+
# misc
19+
.DS_Store
20+
.env*
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*

‎components/nav.js‎

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
import React from 'react'
2+
import Link from 'next/link'
3+
4+
const links = [
5+
{ href: 'https://zeit.co/now', label: 'ZEIT' },
6+
{ href: 'https://github.com/zeit/next.js', label: 'GitHub' }
7+
].map(link => {
8+
link.key = `nav-link-${link.href}-${link.label}`
9+
return link
10+
})
11+
12+
const Nav = () => (
13+
<nav>
14+
<ul>
15+
<li>
16+
<Link href='/'>
17+
<a>Home</a>
18+
</Link>
19+
</li>
20+
{links.map(({ key, href, label }) => (
21+
<li key={key}>
22+
<a href={href}>{label}</a>
23+
</li>
24+
))}
25+
</ul>
26+
27+
<style jsx>{`
28+
:global(body) {
29+
margin: 0;
30+
font-family: -apple-system, BlinkMacSystemFont, Avenir Next, Avenir,
31+
Helvetica, sans-serif;
32+
}
33+
nav {
34+
text-align: center;
35+
}
36+
ul {
37+
display: flex;
38+
justify-content: space-between;
39+
}
40+
nav > ul {
41+
padding: 4px 16px;
42+
}
43+
li {
44+
display: flex;
45+
padding: 6px 8px;
46+
}
47+
a {
48+
color: #067df7;
49+
text-decoration: none;
50+
font-size: 13px;
51+
}
52+
`}</style>
53+
</nav>
54+
)
55+
56+
export default Nav

‎package.json‎

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
{
2+
"name": "getting-started-nextjs-apollo",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build",
8+
"start": "next start"
9+
},
10+
"dependencies": {
11+
"@apollo/react-hooks": "^3.1.3",
12+
"apollo-cache-inmemory": "^1.6.3",
13+
"apollo-client": "^2.6.4",
14+
"apollo-link-http": "^1.5.16",
15+
"graphql": "^14.5.8",
16+
"graphql-tag": "^2.10.1",
17+
"isomorphic-unfetch": "^3.0.0",
18+
"next": "9.1.2",
19+
"next-with-apollo": "^4.3.0",
20+
"react": "16.11.0",
21+
"react-dom": "16.11.0"
22+
}
23+
}

‎pages/index.js‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
import React from 'react'
2+
import Head from 'next/head'
3+
import Nav from '../components/nav'
4+
5+
const Home = () => (
6+
<div>
7+
<Head>
8+
<title>Home</title>
9+
<link rel='icon' href='/favicon.ico' />
10+
</Head>
11+
12+
<Nav />
13+
14+
<div className='hero'>
15+
<h1 className='title'>Welcome to Next.js!</h1>
16+
</div>
17+
18+
<style jsx>{`
19+
.hero {
20+
width: 100%;
21+
color: #333;
22+
}
23+
.title {
24+
margin: 0;
25+
width: 100%;
26+
padding-top: 80px;
27+
line-height: 1.15;
28+
font-size: 48px;
29+
}
30+
.title,
31+
.description {
32+
text-align: center;
33+
}
34+
.row {
35+
max-width: 880px;
36+
margin: 80px auto 40px;
37+
display: flex;
38+
flex-direction: row;
39+
justify-content: space-around;
40+
}
41+
.card {
42+
padding: 18px 18px 24px;
43+
width: 220px;
44+
text-align: left;
45+
text-decoration: none;
46+
color: #434343;
47+
border: 1px solid #9b9b9b;
48+
}
49+
.card:hover {
50+
border-color: #067df7;
51+
}
52+
.card h3 {
53+
margin: 0;
54+
color: #067df7;
55+
font-size: 18px;
56+
}
57+
.card p {
58+
margin: 0;
59+
padding: 12px 0 0;
60+
font-size: 13px;
61+
color: #333;
62+
}
63+
`}</style>
64+
</div>
65+
)
66+
67+
export default Home

‎public/favicon.ico‎

14.7 KB
Binary file not shown.

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /