Skip to content

Commit 4e38c08

Browse files
authored
Merge pull request #1 from Lalit2005/microbundle
Use microbundle
2 parents 4b15085 + 0f21e38 commit 4e38c08

27 files changed

+4324
-20160
lines changed

example/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": "next/core-web-vitals"
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: 18 additions & 2010 deletions
Large diffs are not rendered by default.

example/next-env.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/types/global" />
3+
/// <reference types="next/image-types/global" />
4+
5+
// NOTE: This file should not be edited
6+
// see https://nextjs.org/docs/basic-features/typescript for more information.

example/next.config.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/** @type {import('next').NextConfig} */
2+
module.exports = {
3+
reactStrictMode: true,
4+
}

example/package.json

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,23 @@
11
{
2-
"name": "use-web3forms-example",
3-
"homepage": "https://Lalit2005.github.io/use-web3forms",
4-
"version": "0.0.0",
5-
"license": "MIT",
2+
"name": "example",
3+
"version": "0.1.0",
64
"private": true,
5+
"scripts": {
6+
"dev": "next dev",
7+
"build": "next build && next export",
8+
"start": "next start",
9+
"lint": "next lint"
10+
},
711
"dependencies": {
8-
"react": "link:../node_modules/react",
9-
"react-dom": "^16.9.0",
10-
"react-scripts": "^3.0.1",
12+
"next": "11.1.2",
13+
"react": "17.0.2",
14+
"react-dom": "17.0.2",
1115
"use-web3forms": "link:.."
1216
},
13-
"scripts": {
14-
"start": "react-scripts start",
15-
"build": "react-scripts build",
16-
"test": "react-scripts test --env=jsdom",
17-
"eject": "react-scripts eject"
18-
},
19-
"browserslist": [
20-
">0.2%",
21-
"not dead",
22-
"not ie <= 11",
23-
"not op_mini all"
24-
]
17+
"devDependencies": {
18+
"@types/react": "17.0.22",
19+
"eslint": "7.32.0",
20+
"eslint-config-next": "11.1.2",
21+
"typescript": "4.4.3"
22+
}
2523
}

example/pages/_app.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import '../styles/globals.css'
2+
import type { AppProps } from 'next/app'
3+
4+
function MyApp({ Component, pageProps }: AppProps) {
5+
return <Component {...pageProps} />
6+
}
7+
export default MyApp

example/pages/index.tsx

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
import type { NextPage } from "next";
2+
import Head from "next/head";
3+
import Image from "next/image";
4+
import styles from "../styles/Home.module.css";
5+
import useWeb3forms from "use-web3forms";
6+
7+
const Home: NextPage = () => {
8+
const { submit } = useWeb3forms<{
9+
hello: string;
10+
isWorking: boolean | "Probably";
11+
}>({
12+
apikey: "YOUR_ACCESS_KEY_HERE",
13+
onSuccess: (data) => {
14+
alert(JSON.stringify(data));
15+
},
16+
onError: (error) => {
17+
alert(JSON.stringify(error));
18+
},
19+
});
20+
21+
return (
22+
<div className={styles.container}>
23+
<Head>
24+
<title>Create Next App</title>
25+
<meta name="description" content="Generated by create next app" />
26+
<link rel="icon" href="/favicon.ico" />
27+
</Head>
28+
29+
<main className={styles.main}>
30+
<h1 className={styles.title}>
31+
Welcome to <a href="https://nextjs.org">Next.js!</a>
32+
</h1>
33+
<button
34+
onClick={() => {
35+
submit({
36+
hello: "world",
37+
isWorking: "Probably",
38+
});
39+
}}>
40+
Submit
41+
</button>
42+
<p className={styles.description}>
43+
Get started by editing{" "}
44+
<code className={styles.code}>pages/index.js</code>
45+
</p>
46+
47+
<div className={styles.grid}>
48+
<a href="https://nextjs.org/docs" className={styles.card}>
49+
<h2>Documentation &rarr;</h2>
50+
<p>Find in-depth information about Next.js features and API.</p>
51+
</a>
52+
53+
<a href="https://nextjs.org/learn" className={styles.card}>
54+
<h2>Learn &rarr;</h2>
55+
<p>Learn about Next.js in an interactive course with quizzes!</p>
56+
</a>
57+
58+
<a
59+
href="https://github.com/vercel/next.js/tree/master/examples"
60+
className={styles.card}>
61+
<h2>Examples &rarr;</h2>
62+
<p>Discover and deploy boilerplate example Next.js projects.</p>
63+
</a>
64+
65+
<a
66+
href="https://vercel.com/new?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
67+
className={styles.card}>
68+
<h2>Deploy &rarr;</h2>
69+
<p>
70+
Instantly deploy your Next.js site to a public URL with Vercel.
71+
</p>
72+
</a>
73+
</div>
74+
</main>
75+
76+
<footer className={styles.footer}>
77+
<a
78+
href="https://vercel.com?utm_source=create-next-app&utm_medium=default-template&utm_campaign=create-next-app"
79+
target="_blank"
80+
rel="noopener noreferrer">
81+
Powered by{" "}
82+
<span className={styles.logo}>
83+
<Image src="/vercel.svg" alt="Vercel Logo" width={72} height={16} />
84+
</span>
85+
</a>
86+
</footer>
87+
</div>
88+
);
89+
};
90+
91+
export default Home;

example/public/favicon.ico

25.3 KB
Binary file not shown.

example/public/index.html

Lines changed: 0 additions & 20 deletions
This file was deleted.

0 commit comments

Comments
 (0)