From 10e7a29023e5f9af23d8d0ef19e0faa6f7af6b5f Mon Sep 17 00:00:00 2001 From: Ken Vu Date: Mon, 28 Mar 2022 11:19:34 +1300 Subject: [PATCH] Add `next-seo` and setup page title for each section --- package.json | 1 + pages/_app.tsx | 11 ++++++----- pages/_document.tsx | 2 ++ pages/bridge.tsx | 2 ++ pages/pool.tsx | 2 ++ pages/swap.tsx | 2 ++ yarn.lock | 12 ++++++++++++ 7 files changed, 27 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 80feb713..2002ce1b 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "ethers": "^5.6.0", "lodash": "^4.17.21", "next": "^12.1.0", + "next-seo": "^5.2.0", "react": "^17.0.2", "react-device-detect": "^2.1.2", "react-dom": "^17.0.2", diff --git a/pages/_app.tsx b/pages/_app.tsx index b0e22bb0..f3c9c001 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -19,6 +19,7 @@ import MetaMaskWalletProvider from "@/providers/MetaMaskWalletProvider"; import { useRouter } from "next/router"; import { useEffect } from "react"; import { trackPageView } from "@/utils"; +import { DefaultSeo } from "next-seo"; type MyAppProps = Omit & { pageProps: {} & GlobalProps; @@ -38,11 +39,11 @@ function MyApp({ Component, pageProps }: MyAppProps) { return ( <> - - CENNZnet App Hub - - - + diff --git a/pages/_document.tsx b/pages/_document.tsx index 8077dea5..39692786 100644 --- a/pages/_document.tsx +++ b/pages/_document.tsx @@ -34,6 +34,8 @@ class MyDocument extends Document { rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto+Mono:400,600&display=swap" /> + +
diff --git a/pages/bridge.tsx b/pages/bridge.tsx index 89bc19fd..f86d3835 100644 --- a/pages/bridge.tsx +++ b/pages/bridge.tsx @@ -10,6 +10,7 @@ import BridgeProvider from "@/providers/BridgeProvider"; import { fetchBridgeTokens } from "@/utils"; import { BridgedEthereumToken, EthereumToken } from "@/types"; import BridgeProgress from "@/components/BridgeProgress"; +import { NextSeo } from "next-seo"; export async function getStaticProps() { const api = await Api.create({ provider: API_URL }); @@ -31,6 +32,7 @@ const Bridge: VFC<{ depositTokens={depositTokens} withdrawTokens={withdrawTokens} > + diff --git a/pages/pool.tsx b/pages/pool.tsx index e745342b..606cad50 100644 --- a/pages/pool.tsx +++ b/pages/pool.tsx @@ -12,6 +12,7 @@ import PoolAssetsPair from "@/components/PoolAssetsPair"; import PoolStats from "@/components/PoolStats"; import PoolSettings from "@/components/PoolSettings"; import PoolProgress from "@/components/PoolProgress"; +import { NextSeo } from "next-seo"; export async function getStaticProps() { const api = await Api.create({ provider: API_URL }); @@ -27,6 +28,7 @@ export async function getStaticProps() { const Pool: VFC<{ supportedAssets: CENNZAsset[] }> = ({ supportedAssets }) => { return ( + diff --git a/pages/swap.tsx b/pages/swap.tsx index 4462aae9..4f23955b 100644 --- a/pages/swap.tsx +++ b/pages/swap.tsx @@ -11,6 +11,7 @@ import SwapSettings from "@/components/SwapSettings"; import SwapProgress from "@/components/SwapProgress"; import MainPanel from "@/components/MainPanel"; import { VFC } from "react"; +import { NextSeo } from "next-seo"; export async function getStaticProps() { const api = await Api.create({ provider: API_URL }); @@ -26,6 +27,7 @@ export async function getStaticProps() { const Swap: VFC<{ supportedAssets: CENNZAsset[] }> = ({ supportedAssets }) => { return ( + diff --git a/yarn.lock b/yarn.lock index aadafa35..730ed18e 100644 --- a/yarn.lock +++ b/yarn.lock @@ -561,6 +561,7 @@ __metadata: jest: ^27.5.1 lodash: ^4.17.21 next: ^12.1.0 + next-seo: ^5.2.0 prettier: ^2.5.1 react: ^17.0.2 react-device-detect: ^2.1.2 @@ -6554,6 +6555,17 @@ __metadata: languageName: node linkType: hard +"next-seo@npm:^5.2.0": + version: 5.2.0 + resolution: "next-seo@npm:5.2.0" + peerDependencies: + next: ^8.1.1-canary.54 || >=9.0.0 + react: ">=16.0.0" + react-dom: ">=16.0.0" + checksum: 392f0b4b9d2d2d6873c163c39ca470580ec0031c3941c8da5bdbce154368ceda10aee97a639d1e209318e4c878bafc9bf4a1600355205eac6ac9ca9102ad1801 + languageName: node + linkType: hard + "next-tick@npm:~1.0.0": version: 1.0.0 resolution: "next-tick@npm:1.0.0"