diff --git a/pages/index.tsx b/pages/index.tsx index cd88502..44fec54 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,46 +1,80 @@ -import React, { useEffect } from 'react'; -import Head from 'next/head'; -import { NextPage, GetStaticProps } from 'next'; -import { FeeData, getFeeData, getUniswapV1Data, getUniswapV2Data, getSushiswapData } from 'data/feeData'; -import { getBalancerData } from 'data/balancer'; -import { getCurveData } from 'data/curve'; -import { getOmenData } from 'data/omen'; -import { get0xData } from 'data/zerox'; -import { getRenData } from 'data/ren'; -import { getSynthetixData } from 'data/synthetix'; -import { getPolymarketData } from 'data/polymarket'; -import { getPolkadotData, getKusamaData } from 'data/polkadot'; -import List from 'components/List'; -import ReactGA from 'react-ga'; +import React, { useEffect } from 'react' +import Head from 'next/head' +import { NextPage, GetStaticProps } from 'next' +import { + FeeData, + getFeeData, + getUniswapV1Data, + getUniswapV2Data, + getSushiswapData, +} from 'data/feeData' +import { getBalancerData } from 'data/balancer' +import { getCurveData } from 'data/curve' +import { getOmenData } from 'data/omen' +import { get0xData } from 'data/zerox' +import { getRenData } from 'data/ren' +import { getSynthetixData } from 'data/synthetix' +import { getPolymarketData } from 'data/polymarket' +import { getPolkadotData, getKusamaData } from 'data/polkadot' +import List from 'components/List' +import ReactGA from 'react-ga' interface HomeProps { - data: FeeData[]; + data: FeeData[] } -const ASSETS = ['eth', 'btc', 'ltc', 'ada', 'xtz', 'bsv', 'bch', 'xrp', 'doge', 'xmr', 'xlm', 'bnb_mainnet']; - -ReactGA.initialize("UA-150445352-3") +const ASSETS = [ + 'eth', + 'btc', + 'ltc', + 'ada', + 'xtz', + 'bsv', + 'bch', + 'xrp', + 'doge', + 'xmr', + 'xlm', + 'bnb_mainnet', +] + +ReactGA.initialize('UA-150445352-3') export const Home: NextPage = ({ data }) => { useEffect(() => { - ReactGA.set({ page: window.location.pathname }); - ReactGA.pageview(window.location.pathname); - }, []); + ReactGA.set({ page: window.location.pathname }) + ReactGA.pageview(window.location.pathname) + }, []) return (
Crypto Fees - - + + - - + + - - + + @@ -48,12 +82,19 @@ export const Home: NextPage = ({ data }) => {

Crypto Fees

- There's tons of crypto projects.
+ There's tons of crypto projects. +
Which ones are people actually paying to use?

- Tweet + + Tweet +
@@ -62,10 +103,22 @@ export const Home: NextPage = ({ data }) => {
Data updates at midnight, UTC
-
Network data from CoinMetrics, application data from The Graph
+
+ Network data from CoinMetrics, application data from The Graph +
Application data does not include Ethereum transaction fees
-
Created by David Mihal
-
Design help from @heyheeyheeey
+
+ Created by{' '} + + David Mihal + +
+
+ Design help from{' '} + + @heyheeyheeey + +
- ); -}; + ) +} -export const getStaticProps: GetStaticProps = async ({ res }) => { +export const getStaticProps: GetStaticProps = async () => { const handleFailure = (e: any) => { - console.warn(e); - return null; + console.warn(e) + return null } const [assetData, ...appData] = await Promise.all([ @@ -173,15 +226,11 @@ export const getStaticProps: GetStaticProps = async ({ res }) => { getRenData().catch(handleFailure), getSushiswapData().catch(handleFailure), getSynthetixData().catch(handleFailure), - ]); + ]) - const data = [...assetData, ...appData].filter((val: any) => !!val); + const data = [...assetData, ...appData].filter((val: any) => !!val) - if (res) { - res.setHeader('Cache-Control', 's-maxage=1800'); - } - - return { props: { data }, revalidate: 60 }; -}; + return { props: { data }, revalidate: 60 } +} export default Home