Skip to content

Commit 7f196ef

Browse files
Merge pull request #815 from OpenZeppelin/fix-metatags
2 parents 1fb6ddd + fff16ce commit 7f196ef

11 files changed

Lines changed: 40 additions & 251 deletions

File tree

client/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
"react": "18.2.0",
2626
"react-dom": "18.2.0",
2727
"react-ga": "^3.3.0",
28-
"react-helmet": "^6.1.0",
2928
"react-markdown": "^8.0.0",
3029
"react-onclickoutside": "^6.12.2",
3130
"react-paginate": "^8.1.4",

client/public/index.html

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,34 @@
44
<meta charset="utf-8" />
55
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
66
<meta name="viewport" content="width=device-width, initial-scale=1" />
7+
<title>The Ethernaut</title>
8+
<meta name="title" content="The Ethernaut" />
9+
<meta
10+
name="description"
11+
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'."
12+
/>
13+
<meta property="og:type" content="website" />
14+
<meta property="og:url" content="https://ethernaut.openzeppelin.com/" />
15+
<meta property="og:title" content="The Ethernaut" />
16+
<meta
17+
property="og:description"
18+
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'."
19+
/>
20+
<meta
21+
property="og:image"
22+
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
23+
/>
24+
<meta name="twitter:card" content="summary_large_image" />
25+
<meta name="twitter:site" content="@OpenZeppelin" />
26+
<meta name="twitter:title" content="The Ethernaut" />
27+
<meta
28+
name="twitter:description"
29+
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'."
30+
/>
31+
<meta
32+
name="twitter:image"
33+
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
34+
/>
735
<link rel="shortcut icon" href="%PUBLIC_URL%/imgs/favicon.ico?v=1" />
836
<link
937
rel="stylesheet"

client/src/components/not-found/NotFound404.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ import { loadTranslations } from "../../utils/translations";
55
import { randBadIcon } from "../../utils/^^";
66
import "../../styles/app.css";
77
import Footer from "../common/Footer";
8-
import { Helmet } from "react-helmet";
98

109
class NotFound404 extends React.Component {
1110
render() {
@@ -14,42 +13,6 @@ class NotFound404 extends React.Component {
1413

1514
return (
1615
<div className="helpcontainer">
17-
<Helmet>
18-
<title>The Ethernaut - Not Found 404</title>
19-
{/* <!-- Primary Meta Tags --> */}
20-
<meta name="title" content="The Ethernaut - Not Found 404" />
21-
<meta
22-
name="description"
23-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Not Found 404"
24-
/>
25-
{/* <!-- Open Graph / Facebook --> */}
26-
<meta property="og:type" content="website" />
27-
<meta
28-
property="og:url"
29-
content="https://ethernaut.openzeppelin.com/404"
30-
/>
31-
<meta property="og:title" content="The Ethernaut - Not Found 404" />
32-
<meta
33-
property="og:description"
34-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Not Found 404"
35-
/>
36-
<meta
37-
property="og:image"
38-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
39-
/>
40-
{/* <!-- Twitter --> */}
41-
<meta name="twitter:card" content="summary_large_image" />
42-
<meta name="twitter:site" content="@OpenZeppelin" />
43-
<meta name="twitter:title" content="The Ethernaut - Not Found 404" />
44-
<meta
45-
name="twitter:description"
46-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Not Found 404"
47-
/>
48-
<meta
49-
name="twitter:image"
50-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
51-
/>
52-
</Helmet>
5316
<div className="lines"></div>
5417
<main className="page-not-found-container">
5518
<h1>{randBadIcon()}</h1>

client/src/containers/App.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ import {
1616
deprecationStatus,
1717
deprecationDate,
1818
} from "../utils/networkDeprecation";
19-
import { Helmet } from "react-helmet";
2019
import { store } from "./../store";
2120
import * as actions from "../../src/actions";
2221

@@ -149,42 +148,6 @@ class App extends React.Component {
149148

150149
return (
151150
<div className="appcontainer">
152-
<Helmet>
153-
<title>The Ethernaut</title>
154-
{/* <!-- Primary Meta Tags --> */}
155-
<meta name="title" content="The Ethernaut" />
156-
<meta
157-
name="description"
158-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'."
159-
/>
160-
{/* <!-- Open Graph / Facebook --> */}
161-
<meta property="og:type" content="website" />
162-
<meta
163-
property="og:url"
164-
content="https://ethernaut.openzeppelin.com/"
165-
/>
166-
<meta property="og:title" content="The Ethernaut" />
167-
<meta
168-
property="og:description"
169-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'."
170-
/>
171-
<meta
172-
property="og:image"
173-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
174-
/>
175-
{/* <!-- Twitter --> */}
176-
<meta name="twitter:card" content="summary_large_image" />
177-
<meta name="twitter:site" content="@OpenZeppelin" />
178-
<meta name="twitter:title" content="The Ethernaut" />
179-
<meta
180-
name="twitter:description"
181-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'."
182-
/>
183-
<meta
184-
name="twitter:image"
185-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
186-
/>
187-
</Helmet>
188151
{/* Parent container */}
189152
<main>
190153
{/* Main title and buttons */}

client/src/containers/Header.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import React from "react";
22
import onClickOutside from "react-onclickoutside";
33
import { connect } from "react-redux";
44
import { withRouter } from "../hoc/withRouter";
5-
import { Link, Navigate } from "react-router-dom";
5+
import { Link} from "react-router-dom";
66
import { bindActionCreators } from "redux";
77
import * as actions from "../actions";
88
import * as constants from "../constants";
@@ -12,7 +12,6 @@ import { ProgressBar } from "react-loader-spinner";
1212
import { svgFilter } from "../utils/svg";
1313
import LeaderIcon from "../components/leaderboard/LeaderIcon";
1414
import { store } from "../store";
15-
// import parse from "html-react-parser";
1615

1716
class Header extends React.Component {
1817
constructor(props) {

client/src/containers/Help.js

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ import { bindActionCreators } from "redux";
44
import MarkdownComponent from "../components/common/Markdown";
55
import { loadTranslations } from "../utils/translations";
66
import Footer from "../components/common/Footer";
7-
import { Helmet } from 'react-helmet';
87

98
class Help extends React.Component {
109
render() {
@@ -13,43 +12,6 @@ class Help extends React.Component {
1312

1413
return (
1514
<div className="helpcontainer main-wrapper">
16-
<Helmet>
17-
<title>The Ethernaut - Help</title>
18-
{/* <!-- Primary Meta Tags --> */}
19-
<meta name="title" content="The Ethernaut - Help" />
20-
<meta
21-
name="description"
22-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Help"
23-
/>
24-
{/* <!-- Open Graph / Facebook --> */}
25-
<meta property="og:type" content="website" />
26-
<meta
27-
property="og:url"
28-
content="https://ethernaut.openzeppelin.com/help"
29-
/>
30-
<meta property="og:title" content="The Ethernaut - Help" />
31-
<meta
32-
property="og:description"
33-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Help"
34-
/>
35-
<meta
36-
property="og:image"
37-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
38-
/>
39-
{/* <!-- Twitter --> */}
40-
<meta name="twitter:card" content="summary_large_image" />
41-
<meta name="twitter:site" content="@OpenZeppelin" />
42-
<meta name="twitter:title" content="The Ethernaut - Help" />
43-
<meta
44-
name="twitter:description"
45-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Help"
46-
/>
47-
<meta
48-
name="twitter:image"
49-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
50-
/>
51-
</Helmet>
52-
5315
<div className="lines"></div>
5416
<main className="boxes">
5517
<h3>Setup Metamask</h3>

client/src/containers/Leaderboard.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ import { NETWORKS } from "client/src/constants";
99
import Footer from "../components/common/Footer";
1010
import axios from "axios";
1111
import { ALIAS_PATH, getLeaderboardPath } from "client/src/constants";
12-
import { Helmet } from "react-helmet";
1312

1413
const playersPerPage = 20;
1514

@@ -124,42 +123,6 @@ function Leaderboard() {
124123

125124
return (
126125
<main className="main-wrapper">
127-
<Helmet>
128-
<title>The Ethernaut - Leaderboard</title>
129-
{/* <!-- Primary Meta Tags --> */}
130-
<meta name="title" content="The Ethernaut - Leaderboard" />
131-
<meta
132-
name="description"
133-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Leaderboard"
134-
/>
135-
{/* <!-- Open Graph / Facebook --> */}
136-
<meta property="og:type" content="website" />
137-
<meta
138-
property="og:url"
139-
content="https://ethernaut.openzeppelin.com/leaderboard"
140-
/>
141-
<meta property="og:title" content="The Ethernaut - Leaderboard" />
142-
<meta
143-
property="og:description"
144-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Leaderboard"
145-
/>
146-
<meta
147-
property="og:image"
148-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
149-
/>
150-
{/* <!-- Twitter --> */}
151-
<meta name="twitter:card" content="summary_large_image" />
152-
<meta name="twitter:site" content="@OpenZeppelin" />
153-
<meta name="twitter:title" content="The Ethernaut - Leaderboard" />
154-
<meta
155-
name="twitter:description"
156-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Leaderboard"
157-
/>
158-
<meta
159-
name="twitter:image"
160-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
161-
/>
162-
</Helmet>
163126
<div className="boxes leaderboard-body">
164127
<div className="leaderboard-heading">
165128
<div className="leaderboard-title">Leaderboard</div>

client/src/containers/Level.js

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ import { withRouter } from "../hoc/withRouter";
1414
import { getLevelKey } from "../utils/contractutil";
1515
import { deployAndRegisterLevel } from "../utils/deploycontract";
1616
import { svgFilter } from "../utils/svg";
17-
import { Helmet } from 'react-helmet';
1817
import { store } from "../store";
1918

2019
class Level extends React.Component {
@@ -152,42 +151,6 @@ class Level extends React.Component {
152151

153152
return (
154153
<main className="main-wrapper">
155-
<Helmet>
156-
<title>{`The Ethernaut - ${level.name}`}</title>
157-
{/* <!-- Primary Meta Tags --> */}
158-
<meta name="title" content={`The Ethernaut - ${level.name}`} />
159-
<meta
160-
name="description"
161-
content={`Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - ${level.name}`}
162-
/>
163-
{/* <!-- Open Graph / Facebook --> */}
164-
<meta property="og:type" content="website" />
165-
<meta
166-
property="og:url"
167-
content={`https://ethernaut.openzeppelin.com/level/${level.deployedAddress || level.id}`}
168-
/>
169-
<meta property="og:title" content={`The Ethernaut - ${level.name}`} />
170-
<meta
171-
property="og:description"
172-
content={`Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - ${level.name}`}
173-
/>
174-
<meta
175-
property="og:image"
176-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
177-
/>
178-
{/* <!-- Twitter --> */}
179-
<meta name="twitter:card" content="summary_large_image" />
180-
<meta name="twitter:site" content="@OpenZeppelin" />
181-
<meta name="twitter:title" content={`The Ethernaut - ${level.name}`} />
182-
<meta
183-
name="twitter:description"
184-
content={`Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - ${level.name}`}
185-
/>
186-
<meta
187-
name="twitter:image"
188-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
189-
/>
190-
</Helmet>
191154
<main className="main-wrapper">
192155
{(isDescriptionMissingTranslation ||
193156
isCompleteDescriptionMissingTranslation) && (
@@ -238,7 +201,7 @@ class Level extends React.Component {
238201

239202
<section onLoad={this.handleImageLoad}>
240203
<img
241-
alt={`${level.name} level image`}
204+
alt={`${level.name} level`}
242205
className="level-tile level-img-view"
243206
src={selectedLevel.src}
244207
/>

client/src/containers/Stats.js

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import { validateAddress } from '../utils/ethutil'
88
import Statistic from '../components/stats/Statistic';
99
import StatisticPanel from '../components/stats/Panel';
1010
import Footer from "../components/common/Footer";
11-
import { Helmet } from 'react-helmet';
1211

1312
class Stats extends React.Component {
1413

@@ -104,42 +103,6 @@ class Stats extends React.Component {
104103

105104
render() {
106105
return <div className="stats-page page-container main-wrapper">
107-
<Helmet>
108-
<title>The Ethernaut - Statistics</title>
109-
{/* <!-- Primary Meta Tags --> */}
110-
<meta name="title" content="The Ethernaut - Statistics" />
111-
<meta
112-
name="description"
113-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Statistics"
114-
/>
115-
{/* <!-- Open Graph / Facebook --> */}
116-
<meta property="og:type" content="website" />
117-
<meta
118-
property="og:url"
119-
content="https://ethernaut.openzeppelin.com/stats"
120-
/>
121-
<meta property="og:title" content="The Ethernaut - Statistics" />
122-
<meta
123-
property="og:description"
124-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Statistics"
125-
/>
126-
<meta
127-
property="og:image"
128-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
129-
/>
130-
{/* <!-- Twitter --> */}
131-
<meta name="twitter:card" content="summary_large_image" />
132-
<meta name="twitter:site" content="@OpenZeppelin" />
133-
<meta name="twitter:title" content="The Ethernaut - Statistics" />
134-
<meta
135-
name="twitter:description"
136-
content="Web3/Solidity based wargame played in the Ethereum Virtual Machine. Each level is a smart contract that needs to be 'hacked'. - Statistics"
137-
/>
138-
<meta
139-
name="twitter:image"
140-
content="https://ethernaut.openzeppelin.com/imgs/metatag.png"
141-
/>
142-
</Helmet>
143106
<div className='stats-header'>
144107
<Statistic heading="Total number of players" value={this.state.totalPlayers} />
145108
<Statistic heading="Total number of instances created" value={this.state.totalCreated} />

0 commit comments

Comments
 (0)