Skip to content

Commit b5f7273

Browse files
committed
Initial commit
1 parent 99497b7 commit b5f7273

File tree

11 files changed

+839
-1
lines changed

11 files changed

+839
-1
lines changed

.gitignore

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
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+
*.pem
21+
22+
# debug
23+
npm-debug.log*
24+
yarn-debug.log*
25+
yarn-error.log*
26+
.pnpm-debug.log*
27+
28+
# local env files
29+
.env*.local
30+
31+
# vercel
32+
.vercel
33+
34+
# typescript
35+
*.tsbuildinfo
36+
next-env.d.ts

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
# codespaces-try-nextjs
1+
# Next.js
2+
3+
Next.js starter

components/Button.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import styles from './Button.module.css'
2+
3+
export default function Button(props) {
4+
return <button type="button" className={styles.btn} {...props} />
5+
}

components/Button.module.css

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
button.btn {
2+
margin: 0;
3+
border: 1px solid #d1d1d1;
4+
border-radius: 5px;
5+
padding: 0.5em;
6+
vertical-align: middle;
7+
white-space: normal;
8+
background: none;
9+
line-height: 1;
10+
font-size: 1rem;
11+
font-family: inherit;
12+
transition: all 0.2s ease;
13+
}
14+
15+
button.btn {
16+
padding: 0.65em 1em;
17+
background: #0076ff;
18+
color: #fff;
19+
border: none;
20+
cursor: pointer;
21+
transition: all 0.2s ease;
22+
}
23+
button.btn:focus {
24+
outline: 0;
25+
border-color: #0076ff;
26+
}
27+
button.btn:hover {
28+
background: rgba(0, 118, 255, 0.8);
29+
}
30+
button.btn:focus {
31+
box-shadow: 0 0 0 2px rgba(0, 118, 255, 0.5);
32+
}

components/ClickCount.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import { useCallback, useState } from 'react'
2+
import Button from './Button'
3+
4+
export default function ClickCount() {
5+
const [count, setCount] = useState(0)
6+
const increment = useCallback(() => {
7+
setCount((v) => v + 1)
8+
}, [setCount])
9+
10+
return <Button onClick={increment}>Clicks: {count}</Button>
11+
}

global.css

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
body {
2+
font-family: 'SF Pro Text', 'SF Pro Icons', 'Helvetica Neue', 'Helvetica',
3+
'Arial', sans-serif;
4+
margin: 0 auto;
5+
font-size: 16px;
6+
line-height: 1.65;
7+
word-break: break-word;
8+
font-kerning: auto;
9+
font-variant: normal;
10+
-webkit-font-smoothing: antialiased;
11+
-moz-osx-font-smoothing: grayscale;
12+
text-rendering: optimizeLegibility;
13+
hyphens: auto;
14+
}

0 commit comments

Comments
 (0)