Skip to content

Commit 66b7064

Browse files
authored
Add CodeSandbox CI (#32)
1 parent 789ccf8 commit 66b7064

File tree

7 files changed

+4096
-1
lines changed

7 files changed

+4096
-1
lines changed

.codesandbox/ci.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"sandboxes": ["/example"]
3+
}

example/.gitignore

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
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+
27+
# local env files
28+
.env.local
29+
.env.development.local
30+
.env.test.local
31+
.env.production.local
32+
33+
# vercel
34+
.vercel

example/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
2+
3+
## Getting Started
4+
5+
First, run the development server:
6+
7+
```bash
8+
npm run dev
9+
# or
10+
yarn dev
11+
```
12+
13+
Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.

example/package.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "react-use-clipboard-example",
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+
"next": "10.0.4",
12+
"react": "17.0.1",
13+
"react-dom": "17.0.1",
14+
"react-use-clipboard": "^1.0.6"
15+
}
16+
}

example/pages/index.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import useClipboard from "react-use-clipboard";
2+
3+
export default function App() {
4+
const [isCopied, setCopied] = useClipboard("Text to copy", {
5+
// `isCopied` will go back to `false` after 1000ms.
6+
successDuration: 1000,
7+
});
8+
9+
return (
10+
<button onClick={setCopied}>
11+
Was it copied? {isCopied ? "Yes! 👍" : "Nope! 👎"}
12+
</button>
13+
);
14+
}

0 commit comments

Comments
 (0)