Skip to content

Commit

Permalink
Fixed and updated packages
Browse files Browse the repository at this point in the history
  • Loading branch information
adriandelgg committed Nov 8, 2021
1 parent 13714f5 commit f034e5e
Show file tree
Hide file tree
Showing 12 changed files with 108 additions and 70 deletions.
2 changes: 1 addition & 1 deletion frontend/components/navbar/MetaMask.tsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
4 changes: 2 additions & 2 deletions frontend/components/navbar/NavBar.tsx
Original file line number Diff line number Diff line change
@@ -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);
Expand Down
8 changes: 4 additions & 4 deletions frontend/context/Layout.tsx
Original file line number Diff line number Diff line change
@@ -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 }) => (
<>
<Head>
<link rel="icon" href="/bp-logo.svg" />
<link rel="shortcut icon" href="/bp-logo.svg" />
{/* <link rel="icon" href="" /> */}
{/* <link rel="shortcut icon" href="" /> */}
</Head>
<NavBar />
<main>
<div className="text-center mt-6 mb-2">
<Image src="/bp-logo.svg" alt="BP Logo" width={170} height={170} />
{/* <Image src="" alt="" width={170} height={170} /> */}
</div>
{children}
</main>
Expand Down
2 changes: 1 addition & 1 deletion frontend/context/Web3Context.tsx
Original file line number Diff line number Diff line change
@@ -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;

Expand Down
5 changes: 4 additions & 1 deletion frontend/next.config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true
reactStrictMode: true,
images: {
domains: ['ipfs.io']
}
};
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
6 changes: 3 additions & 3 deletions frontend/pages/_app.tsx
Original file line number Diff line number Diff line change
@@ -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 (
Expand Down
8 changes: 8 additions & 0 deletions frontend/postcss.config.js
Original file line number Diff line number Diff line change
@@ -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: {},
},
}
20 changes: 19 additions & 1 deletion frontend/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
const colors = require('tailwindcss/colors');

module.exports = {
mode: 'jit',
purge: ['./pages/**/*.{js,ts,jsx,tsx}', './components/**/*.{js,ts,jsx,tsx}'],
Expand All @@ -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',
Expand All @@ -19,5 +34,8 @@ module.exports = {
variants: {
extend: {}
},
plugins: []
plugins: [require('daisyui')],
daisyui: {
base: false
}
};
6 changes: 1 addition & 5 deletions frontend/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
100 changes: 50 additions & 50 deletions hardhat/hardhat.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: [
{
Expand Down
13 changes: 13 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -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"
}
}

0 comments on commit f034e5e

Please sign in to comment.