Skip to content

Commit

Permalink
feat: add canonical tags
Browse files Browse the repository at this point in the history
  • Loading branch information
just-toby committed Aug 30, 2023
1 parent 42b224a commit e8f4ba8
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v14
v16
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -88,5 +88,8 @@
"last 1 safari version"
]
},
"license": "GPL-3.0-or-later"
"license": "GPL-3.0-or-later",
"dependencies": {
"react-helmet": "^6.1.0"
}
}
2 changes: 2 additions & 0 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import PinnedData from './components/PinnedData'

import SideNav from './components/SideNav'
import AccountLookup from './pages/AccountLookup'
import Meta from './components/Meta'
import LocalLoader from './components/LocalLoader'
import { useLatestBlocks } from './contexts/Application'
import GoogleAnalyticsReporter from './components/analytics/GoogleAnalyticsReporter'
Expand Down Expand Up @@ -83,6 +84,7 @@ const LayoutWrapper = ({ children, savedOpen, setSavedOpen }) => {
return (
<>
<ContentWrapper open={savedOpen}>
<Meta />
<SideNav />
<Center id="center">{children}</Center>
<Right open={savedOpen}>
Expand Down
15 changes: 15 additions & 0 deletions src/components/Meta.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import { Helmet } from 'react-helmet'
import { withRouter, RouteComponentProps } from 'react-router-dom'
import React from 'react'

const WEBSITE_HOST_URL = 'https://v2.info.uniswap.org'

const Meta = ({ location }: RouteComponentProps): JSX.Element => {
return (
<Helmet>
<link rel="canonical" href={`${WEBSITE_HOST_URL}${location.pathname}`} />
</Helmet>
)
}

export default withRouter(Meta)
20 changes: 20 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -10109,6 +10109,11 @@ react-fast-compare@^3.0.1:
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.0.tgz#641a9da81b6a6320f270e89724fb45a0b39e43bb"
integrity sha512-rtGImPZ0YyLrscKI9xTpV8psd6I8VAtjKCzQDlzyDvqJA8XOW78TXYQwNRNd8g8JZnDu8q9Fu/1v4HPAVwVdHA==

react-fast-compare@^3.1.1:
version "3.2.2"
resolved "https://registry.yarnpkg.com/react-fast-compare/-/react-fast-compare-3.2.2.tgz#929a97a532304ce9fee4bcae44234f1ce2c21d49"
integrity sha512-nsO+KSNgo1SbJqJEYRE9ERzo7YtYbou/OqjSQKxV7jcKox7+usiUVZOAC+XnDOABXggQTno0Y1CpVnuWEc1boQ==

react-feather@^2.0.3:
version "2.0.9"
resolved "https://registry.yarnpkg.com/react-feather/-/react-feather-2.0.9.tgz#6e42072130d2fa9a09d4476b0e61b0ed17814480"
Expand All @@ -10121,6 +10126,16 @@ react-ga@^3.1.2:
resolved "https://registry.yarnpkg.com/react-ga/-/react-ga-3.3.0.tgz#c91f407198adcb3b49e2bc5c12b3fe460039b3ca"
integrity sha512-o8RScHj6Lb8cwy3GMrVH6NJvL+y0zpJvKtc0+wmH7Bt23rszJmnqEQxRbyrqUzk9DTJIHoP42bfO5rswC9SWBQ==

react-helmet@^6.1.0:
version "6.1.0"
resolved "https://registry.yarnpkg.com/react-helmet/-/react-helmet-6.1.0.tgz#a750d5165cb13cf213e44747502652e794468726"
integrity sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==
dependencies:
object-assign "^4.1.1"
prop-types "^15.7.2"
react-fast-compare "^3.1.1"
react-side-effect "^2.1.0"

react-iframe@^1.8.0:
version "1.8.0"
resolved "https://registry.yarnpkg.com/react-iframe/-/react-iframe-1.8.0.tgz#8c78f2c59b894ca5605fa7e45e61e27e57e96091"
Expand Down Expand Up @@ -10296,6 +10311,11 @@ react-select@^3.0.7:
react-input-autosize "^3.0.0"
react-transition-group "^4.3.0"

react-side-effect@^2.1.0:
version "2.1.2"
resolved "https://registry.yarnpkg.com/react-side-effect/-/react-side-effect-2.1.2.tgz#dc6345b9e8f9906dc2eeb68700b615e0b4fe752a"
integrity sha512-PVjOcvVOyIILrYoyGEpDN3vmYNLdy1CajSFNt4TDsVQC5KpTijDvWVoR+/7Rz2xT978D8/ZtFceXxzsPwZEDvw==

react-smooth-fork@^1.0.3:
version "1.0.3"
resolved "https://registry.yarnpkg.com/react-smooth-fork/-/react-smooth-fork-1.0.3.tgz#f29179a071ca3180fd21ba662c6ad939f98987cd"
Expand Down

0 comments on commit e8f4ba8

Please sign in to comment.