diff --git a/frontend/components/navbar/MetaMask.tsx b/frontend/components/navbar/MetaMask.tsx index 89efd65..31bbba1 100644 --- a/frontend/components/navbar/MetaMask.tsx +++ b/frontend/components/navbar/MetaMask.tsx @@ -1,5 +1,5 @@ import { useContext } from 'react'; -import { Web3Context } from '@context/Web3Context'; +import { Web3Context } from 'context/Web3Context'; import { Web3Provider } from '@ethersproject/providers'; import { toast } from 'react-toastify'; diff --git a/frontend/components/navbar/NavBar.tsx b/frontend/components/navbar/NavBar.tsx index 1ca8f26..f154538 100644 --- a/frontend/components/navbar/NavBar.tsx +++ b/frontend/components/navbar/NavBar.tsx @@ -1,11 +1,11 @@ import { useContext } from 'react'; import { useRouter } from 'next/router'; import Link from 'next/link'; -import { Web3Context } from '@context/Web3Context'; +import { Web3Context } from 'context/Web3Context'; import { ToastContainer } from 'react-toastify'; import MetaMask from './MetaMask'; -import DarkModeToggle from '@components/helpers/DarkModeToggle'; +import DarkModeToggle from 'components/helpers/DarkModeToggle'; const NavBar = () => { const { etherBalance, tokenBalance } = useContext(Web3Context); diff --git a/frontend/context/Layout.tsx b/frontend/context/Layout.tsx index be81bb7..52748d8 100644 --- a/frontend/context/Layout.tsx +++ b/frontend/context/Layout.tsx @@ -1,17 +1,17 @@ -import NavBar from '@components/navbar/NavBar'; +import NavBar from 'components/navbar/NavBar'; import Head from 'next/head'; import Image from 'next/image'; const Layout: React.FC = ({ children }) => ( <> - - + {/* */} + {/* */}
- BP Logo + {/* */}
{children}
diff --git a/frontend/context/Web3Context.tsx b/frontend/context/Web3Context.tsx index 7720608..4049f49 100644 --- a/frontend/context/Web3Context.tsx +++ b/frontend/context/Web3Context.tsx @@ -1,5 +1,5 @@ import { createContext, useState, useEffect } from 'react'; -import type { Web3 } from '@components/navbar/MetaMask'; +import type { Web3 } from 'components/navbar/MetaMask'; declare let window: any; diff --git a/frontend/next.config.js b/frontend/next.config.js index 5e25612..d3b8a9f 100644 --- a/frontend/next.config.js +++ b/frontend/next.config.js @@ -1,4 +1,7 @@ /** @type {import('next').NextConfig} */ module.exports = { - reactStrictMode: true + reactStrictMode: true, + images: { + domains: ['ipfs.io'] + } }; diff --git a/frontend/package.json b/frontend/package.json index b37c4d3..28341c1 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -2,12 +2,13 @@ "private": true, "scripts": { "dev": "next dev", - "build": "next build && next export", + "build": "next build", "start": "next start", "lint": "next lint" }, "dependencies": { "axios": "^0.21.4", + "daisyui": "^1.14.2", "dotenv": "^10.0.0", "ethers": "^5.4.6", "ipfs-http-client": "^53.0.1", @@ -19,7 +20,6 @@ "react-toggle-dark-mode": "^1.0.4" }, "devDependencies": { - "@types/dotenv": "^8.2.0", "@types/lodash": "^4.14.175", "@types/node": "^16.9.1", "@types/react": "17.0.20", diff --git a/frontend/pages/_app.tsx b/frontend/pages/_app.tsx index ff8ea0b..b1d1d77 100644 --- a/frontend/pages/_app.tsx +++ b/frontend/pages/_app.tsx @@ -1,10 +1,10 @@ import type { AppProps } from 'next/app'; -import '@styles/globals.css'; +import 'styles/globals.css'; import 'react-loader-spinner/dist/loader/css/react-spinner-loader.css'; import 'react-toastify/dist/ReactToastify.css'; -import Web3Provider from '@context/Web3Context'; -import Layout from '@context/Layout'; +import Web3Provider from 'context/Web3Context'; +import Layout from 'context/Layout'; function MyApp({ Component, pageProps }: AppProps) { return ( diff --git a/frontend/postcss.config.js b/frontend/postcss.config.js new file mode 100644 index 0000000..3fa0a95 --- /dev/null +++ b/frontend/postcss.config.js @@ -0,0 +1,8 @@ +// If you want to use other PostCSS plugins, see the following: +// https://tailwindcss.com/docs/using-with-preprocessors +module.exports = { + plugins: { + tailwindcss: {}, + autoprefixer: {}, + }, +} diff --git a/frontend/tailwind.config.js b/frontend/tailwind.config.js index f94b5a6..9133116 100644 --- a/frontend/tailwind.config.js +++ b/frontend/tailwind.config.js @@ -1,3 +1,5 @@ +const colors = require('tailwindcss/colors'); + module.exports = { mode: 'jit', purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'], @@ -8,6 +10,19 @@ module.exports = { xxs: '0.55rem' }, colors: { + blueGray: colors.blueGray, + trueGray: colors.trueGray, + coolGray: colors.coolGray, + warmGray: colors.warmGray, + lime: colors.lime, + emerald: colors.emerald, + teal: colors.teal, + cyan: colors.cyan, + sky: colors.sky, + orange: colors.orange, + violet: colors.violet, + fuchsia: colors.fuchsia, + rose: colors.rose, green: { bp1: '#009900', bp2: '#99cc00', @@ -19,5 +34,8 @@ module.exports = { variants: { extend: {} }, - plugins: [] + plugins: [require('daisyui')], + daisyui: { + base: false + } }; diff --git a/frontend/tsconfig.json b/frontend/tsconfig.json index 3752deb..6145173 100644 --- a/frontend/tsconfig.json +++ b/frontend/tsconfig.json @@ -14,11 +14,7 @@ "isolatedModules": true, "jsx": "preserve", "baseUrl": "./", - "paths": { - "@components/*": ["components/*"], - "@styles/*": ["styles/*"], - "@context/*": ["context/*"] - } + "incremental": true }, "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], "exclude": ["node_modules", "components/typechain"] diff --git a/hardhat/hardhat.config.ts b/hardhat/hardhat.config.ts index efd9673..c828739 100644 --- a/hardhat/hardhat.config.ts +++ b/hardhat/hardhat.config.ts @@ -42,56 +42,56 @@ module.exports = { runOnCompile: true, disambiguatePaths: false }, - networks: { - // hardhat: { - // forking: { - // url: process.env.INFURA_KEY - // } - // }, - // mainnet: { - // url: `https://mainnet.infura.io/v3/${INFURA_KEY}`, - // accounts: [process.env.PRIVATE_KEY] - // }, - rinkeby: { - url: `https://rinkeby.infura.io/v3/${INFURA_KEY}`, - accounts: [process.env.PRIVATE_KEY] - }, - kovan: { - url: `https://kovan.infura.io/v3/${INFURA_KEY}`, - accounts: [process.env.PRIVATE_KEY] - }, - ropsten: { - url: `https://ropsten.infura.io/v3/${INFURA_KEY}`, - accounts: [process.env.PRIVATE_KEY] - }, - goerli: { - url: `https://goerli.infura.io/v3/${INFURA_KEY}` - }, - polygon_mainnet: { - url: `https://polygon-mainnet.infura.io/v3/${INFURA_KEY}`, - accounts: [process.env.PRIVATE_KEY] - }, - mumbai: { - url: `https://polygon-mumbai.infura.io/v3/${INFURA_KEY}`, - accounts: [process.env.PRIVATE_KEY] - }, - arbitrum_mainnet: { - url: `https://arbitrum-mainnet.infura.io/v3/${INFURA_KEY}`, - accounts: [process.env.PRIVATE_KEY] - }, - arbitrum_rinkeby: { - url: `https://arbitrum-rinkeby.infura.io/v3/${INFURA_KEY}`, - accounts: [process.env.PRIVATE_KEY] - }, - optimism_mainnet: { - url: `https://optimism-mainnet.infura.io/v3/${INFURA_KEY}`, - accounts: [process.env.PRIVATE_KEY] - }, - optimism_kovan: { - url: `https://optimism-kovan.infura.io/v3/${INFURA_KEY}`, - accounts: [process.env.PRIVATE_KEY] - } - }, + // networks: { + // // hardhat: { + // // forking: { + // // url: process.env.INFURA_KEY + // // } + // // }, + // // mainnet: { + // // url: `https://mainnet.infura.io/v3/${INFURA_KEY}`, + // // accounts: [process.env.PRIVATE_KEY] + // // }, + // rinkeby: { + // url: `https://rinkeby.infura.io/v3/${INFURA_KEY}`, + // accounts: [process.env.PRIVATE_KEY] + // }, + // kovan: { + // url: `https://kovan.infura.io/v3/${INFURA_KEY}`, + // accounts: [process.env.PRIVATE_KEY] + // }, + // ropsten: { + // url: `https://ropsten.infura.io/v3/${INFURA_KEY}`, + // accounts: [process.env.PRIVATE_KEY] + // }, + // goerli: { + // url: `https://goerli.infura.io/v3/${INFURA_KEY}` + // }, + // polygon_mainnet: { + // url: `https://polygon-mainnet.infura.io/v3/${INFURA_KEY}`, + // accounts: [process.env.PRIVATE_KEY] + // }, + // mumbai: { + // url: `https://polygon-mumbai.infura.io/v3/${INFURA_KEY}`, + // accounts: [process.env.PRIVATE_KEY] + // }, + // arbitrum_mainnet: { + // url: `https://arbitrum-mainnet.infura.io/v3/${INFURA_KEY}`, + // accounts: [process.env.PRIVATE_KEY] + // }, + // arbitrum_rinkeby: { + // url: `https://arbitrum-rinkeby.infura.io/v3/${INFURA_KEY}`, + // accounts: [process.env.PRIVATE_KEY] + // }, + // optimism_mainnet: { + // url: `https://optimism-mainnet.infura.io/v3/${INFURA_KEY}`, + // accounts: [process.env.PRIVATE_KEY] + // }, + // optimism_kovan: { + // url: `https://optimism-kovan.infura.io/v3/${INFURA_KEY}`, + // accounts: [process.env.PRIVATE_KEY] + // } + // }, solidity: { compilers: [ { diff --git a/package.json b/package.json new file mode 100644 index 0000000..f475717 --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "typescript-nextjs-template", + "author": "adriandelgg", + "license": "MIT", + "scripts": { + "dev": "concurrently \"cd ./hardhat && npx hardhat node\" \"cd ./frontend && npm run dev\"", + "hardhat": "cd ./hardhat && hh node", + "frontend": "cd ./frontend && npm run dev" + }, + "devDependencies": { + "concurrently": "^6.2.1" + } +}