diff --git a/bin/installDeps.sh b/bin/installDeps.sh index 6d951df..ea543da 100755 --- a/bin/installDeps.sh +++ b/bin/installDeps.sh @@ -6,4 +6,4 @@ [ -d hardhat ] && cd hardhat && yarn install && cd .. # Renames .example.env files to .env -find . -type f -name .example.env -execdir mv {} .env ";" \ No newline at end of file +find . -type f -name .example.env -execdir mv {} .env ";" diff --git a/frontend/pages/index.tsx b/frontend/pages/index.tsx index 1d50333..10c5c5a 100644 --- a/frontend/pages/index.tsx +++ b/frontend/pages/index.tsx @@ -1,11 +1,14 @@ -import type { NextPage } from "next"; -import Head from "next/head"; +import type { NextPage } from 'next'; +import Head from 'next/head'; const Home: NextPage = () => { return ( - - - + <> + + + +

Good luck building those Dapps!

+ ); }; diff --git a/frontend/src/hooks/useFormChange.tsx b/frontend/src/hooks/useFormChange.tsx new file mode 100644 index 0000000..411cf14 --- /dev/null +++ b/frontend/src/hooks/useFormChange.tsx @@ -0,0 +1,19 @@ +import { useState, ChangeEvent } from "react"; + +export function useFormChange>( + formValues: T +) { + const [values, setValues] = useState(formValues); + + function handleChange({ + currentTarget + }: ChangeEvent) { + const { name, value } = currentTarget; + + setValues(prev => ({ ...prev, [name]: value })); + } + + const resetForm = () => setValues(formValues); + + return [values, handleChange, resetForm, setValues] as const; +} diff --git a/hardhat/hardhat.config.ts b/hardhat/hardhat.config.ts index 383667f..eb9c630 100644 --- a/hardhat/hardhat.config.ts +++ b/hardhat/hardhat.config.ts @@ -1,21 +1,21 @@ /** * @type import('hardhat/config').HardhatUserConfig */ -import { task } from "hardhat/config"; -import "dotenv/config"; -import "@nomiclabs/hardhat-ethers"; -import "@nomiclabs/hardhat-waffle"; -import "@nomiclabs/hardhat-solhint"; -import "@typechain/hardhat"; -import "@typechain/ethers-v5"; -import "hardhat-gas-reporter"; -import "hardhat-contract-sizer"; -import "solidity-coverage"; -import "@openzeppelin/hardhat-upgrades"; +import { task } from 'hardhat/config'; +import 'dotenv/config'; +import '@nomiclabs/hardhat-ethers'; +import '@nomiclabs/hardhat-waffle'; +import '@nomiclabs/hardhat-solhint'; +import '@typechain/hardhat'; +import '@typechain/ethers-v5'; +import 'hardhat-gas-reporter'; +import 'hardhat-contract-sizer'; +import 'solidity-coverage'; +import '@openzeppelin/hardhat-upgrades'; // This is a sample Hardhat task. To learn how to create your own go to // https://hardhat.org/guides/create-task.html -task("accounts", "Prints the list of accounts", async (taskArgs, hre) => { +task('accounts', 'Prints the list of accounts', async (taskArgs, hre) => { const accounts = await hre.ethers.getSigners(); for (const account of accounts) { @@ -26,19 +26,18 @@ task("accounts", "Prints the list of accounts", async (taskArgs, hre) => { const INFURA_KEY = process.env.INFURA_API_KEY; const PRIVATE_KEY = process.env.PRIVATE_KEY || // This is the private key for test account #0 - "ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80"; + 'ac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80'; // You need to export an object to set up your config // Go to https://hardhat.org/config/ to learn more module.exports = { - defaultNetwork: "localhost", gasReporter: { - currency: "USD", + currency: 'USD', coinmarketcap: process.env.COINMARKETCAP_API_KEY ? true : false, maxMethodDiff: 10, enabled: process.env.REPORT_GAS ? true : false, excludeContracts: [], - src: "./contracts" + src: './contracts' }, contractSizer: { alphaSort: true, @@ -99,7 +98,7 @@ module.exports = { solidity: { compilers: [ { - version: "0.8.7", + version: '0.8.7', settings: { optimizer: { enabled: true, @@ -108,7 +107,7 @@ module.exports = { } }, { - version: "0.6.12", + version: '0.6.12', settings: { optimizer: { enabled: true, diff --git a/hardhat/scripts/typechain-copy.sh b/hardhat/scripts/typechain-copy.sh index 6598ed1..60f34e4 100755 --- a/hardhat/scripts/typechain-copy.sh +++ b/hardhat/scripts/typechain-copy.sh @@ -1,6 +1,6 @@ #!/bin/bash npx hardhat typechain -[ -d ../frontend ] && cp -r typechain-types ../frontend/lib \ - && echo "Copied typechain types to frontend" -[ -d ../backend ] && cp -r typechain-types ../backend \ - && echo "Copied typechain types to backend" +[ -d ../frontend ] && cp -r typechain-types ../frontend/lib && + echo "Copied typechain types to frontend" +[ -d ../backend ] && cp -r typechain-types ../backend && + echo "Copied typechain types to backend" diff --git a/package.json b/package.json index 1d8c6c2..2b477e7 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "create-ether-dapp", "description": "A template for building Full-Stack Blockchain Dapps using Next.js (React), TypeScript, Tailwind CSS, Hardhat, Solidity, and many more!", - "version": "1.1.6", + "version": "1.1.61", "author": "Adrian Delgado", "license": "MIT", "bin": "./bin/index.js",