From d9319471952f642421dd1e7cca61748226ee7a4f Mon Sep 17 00:00:00 2001
From: xaralis <filip.varecha@fragaria.cz>
Date: Fri, 1 Jan 2021 15:04:05 +0100
Subject: [PATCH] feat: use react-helmet-async instead of react-helmet

---
 package-lock.json      | 25 +++++++++++-----------
 package.json           |  2 +-
 src/App.jsx            | 48 ++++++++++++++++++++++--------------------
 src/pages/Home.jsx     |  2 +-
 src/pages/NotFound.jsx |  2 +-
 src/pages/Program.jsx  |  2 +-
 src/pages/Protocol.jsx |  2 +-
 7 files changed, 43 insertions(+), 40 deletions(-)

diff --git a/package-lock.json b/package-lock.json
index b7a863f..84a988e 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -14556,15 +14556,16 @@
         }
       }
     },
-    "react-helmet": {
-      "version": "6.1.0",
-      "resolved": "https://registry.npmjs.org/react-helmet/-/react-helmet-6.1.0.tgz",
-      "integrity": "sha512-4uMzEY9nlDlgxr61NL3XbKRy1hEkXmKNXhjbAIOVw5vcFrsdYbH2FEwcNyWvWinl103nXgzYNlns9ca+8kFiWw==",
+    "react-helmet-async": {
+      "version": "1.0.7",
+      "resolved": "https://registry.npmjs.org/react-helmet-async/-/react-helmet-async-1.0.7.tgz",
+      "integrity": "sha512-By90p5uxAriGukbyejq2poK41DwTxpNWOpOjN8mIyX/BKrCd3+sXZ5pHUZXjHyjR5OYS7PGsOD9dbM61YxfFmA==",
       "requires": {
-        "object-assign": "^4.1.1",
+        "@babel/runtime": "^7.11.2",
+        "invariant": "^2.2.4",
         "prop-types": "^15.7.2",
-        "react-fast-compare": "^3.1.1",
-        "react-side-effect": "^2.1.0"
+        "react-fast-compare": "^3.2.0",
+        "shallowequal": "^1.1.0"
       }
     },
     "react-intersection-observer": {
@@ -15028,11 +15029,6 @@
         }
       }
     },
-    "react-side-effect": {
-      "version": "2.1.1",
-      "resolved": "https://registry.npmjs.org/react-side-effect/-/react-side-effect-2.1.1.tgz",
-      "integrity": "sha512-2FoTQzRNTncBVtnzxFOk2mCpcfxQpenBMbk5kSVBg5UcPqV9fRbgY2zhb7GTWWOlpFmAxhClBDlIq8Rsubz1yQ=="
-    },
     "read-pkg": {
       "version": "3.0.0",
       "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz",
@@ -15862,6 +15858,11 @@
         }
       }
     },
+    "shallowequal": {
+      "version": "1.1.0",
+      "resolved": "https://registry.npmjs.org/shallowequal/-/shallowequal-1.1.0.tgz",
+      "integrity": "sha512-y0m1JoUZSlPAjXVtPPW70aZWfIL/dSP7AFkRnniLCrK/8MDKog3TySTBmckD+RObVxH0v4Tox67+F14PdED2oQ=="
+    },
     "shebang-command": {
       "version": "1.2.0",
       "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz",
diff --git a/package.json b/package.json
index 18f803e..51d186e 100644
--- a/package.json
+++ b/package.json
@@ -18,7 +18,7 @@
     "pullstate": "^1.20.5",
     "react": "^16.13.1",
     "react-dom": "^16.13.1",
-    "react-helmet": "^6.1.0",
+    "react-helmet-async": "^1.0.7",
     "react-intersection-observer": "^8.31.0",
     "react-joyride": "^2.3.0",
     "react-mde": "^11.0.0",
diff --git a/src/App.jsx b/src/App.jsx
index 0ceedc5..6fd6b79 100644
--- a/src/App.jsx
+++ b/src/App.jsx
@@ -1,5 +1,5 @@
 import React, { Suspense } from "react";
-import { Helmet } from "react-helmet";
+import { Helmet, HelmetProvider } from "react-helmet-async";
 import { BrowserRouter as Router, Route, Switch } from "react-router-dom";
 import { KeycloakProvider } from "@react-keycloak/web";
 import * as Sentry from "@sentry/react";
@@ -85,28 +85,30 @@ const BaseApp = () => {
   initializeWSChannel.read();
 
   return (
-    <Router>
-      <Helmet>
-        <title>CF 2021 | Pirátská strana</title>
-        <meta
-          name="description"
-          content="Oficiální stránka letošního ročníku on-line zasedání Celostátního fóra České pirátské strany, 9. 1. 2021."
-        />
-        <meta property="og:title" content="CF 2021" />
-        <meta
-          property="og:description"
-          content="Oficiální stránka letošního ročníku on-line zasedání Celostátního fóra České pirátské strany, 9. 1. 2021."
-        />
-      </Helmet>
-      <Navbar />
-      <Switch>
-        <Route exact path="/" children={<Home />} />
-        <Route exact path="/program" children={<Program />} />
-        <Route exact path="/protocol" children={<Protocol />} />
-        <Route component={NotFound} />
-      </Switch>
-      <Footer />
-    </Router>
+    <HelmetProvider>
+      <Router>
+        <Helmet>
+          <title>CF 2021 | Pirátská strana</title>
+          <meta
+            name="description"
+            content="Oficiální stránka letošního ročníku on-line zasedání Celostátního fóra České pirátské strany, 9. 1. 2021."
+          />
+          <meta property="og:title" content="CF 2021" />
+          <meta
+            property="og:description"
+            content="Oficiální stránka letošního ročníku on-line zasedání Celostátního fóra České pirátské strany, 9. 1. 2021."
+          />
+        </Helmet>
+        <Navbar />
+        <Switch>
+          <Route exact path="/" children={<Home />} />
+          <Route exact path="/program" children={<Program />} />
+          <Route exact path="/protocol" children={<Protocol />} />
+          <Route component={NotFound} />
+        </Switch>
+        <Footer />
+      </Router>
+    </HelmetProvider>
   );
 };
 
diff --git a/src/pages/Home.jsx b/src/pages/Home.jsx
index 1115287..e2c5602 100644
--- a/src/pages/Home.jsx
+++ b/src/pages/Home.jsx
@@ -1,5 +1,5 @@
 import React, { useEffect, useState } from "react";
-import { Helmet } from "react-helmet";
+import { Helmet } from "react-helmet-async";
 import Joyride, { EVENTS } from "react-joyride";
 import ReactPlayer from "react-player/lazy";
 import useWindowSize from "@rooks/use-window-size";
diff --git a/src/pages/NotFound.jsx b/src/pages/NotFound.jsx
index ee171f4..86715b6 100644
--- a/src/pages/NotFound.jsx
+++ b/src/pages/NotFound.jsx
@@ -1,5 +1,5 @@
 import React from "react";
-import { Helmet } from "react-helmet";
+import { Helmet } from "react-helmet-async";
 
 import Button from "components/Button";
 
diff --git a/src/pages/Program.jsx b/src/pages/Program.jsx
index 9e78c06..0ed75f8 100644
--- a/src/pages/Program.jsx
+++ b/src/pages/Program.jsx
@@ -1,5 +1,5 @@
 import React from "react";
-import { Helmet } from "react-helmet";
+import { Helmet } from "react-helmet-async";
 import { Link } from "react-router-dom";
 import { format } from "date-fns";
 
diff --git a/src/pages/Protocol.jsx b/src/pages/Protocol.jsx
index 9b51c4e..8700e29 100644
--- a/src/pages/Protocol.jsx
+++ b/src/pages/Protocol.jsx
@@ -1,5 +1,5 @@
 import React, { useCallback, useState } from "react";
-import { Helmet } from "react-helmet";
+import { Helmet } from "react-helmet-async";
 import useInterval from "@rooks/use-interval";
 
 import { loadProtocol } from "actions/global-info";
-- 
GitLab