]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/pages/Technique.js
add helmet
[alttp.git] / resources / js / components / pages / Technique.js
index 8c202ed44ad1fce81a80e4b1f89e16481eff8944..e38061106a5d582bf9368fe05d6f6ab34e1a8f91 100644 (file)
@@ -1,5 +1,6 @@
 import axios from 'axios';
 import React, { useEffect, useState } from 'react';
+import { Helmet } from 'react-helmet';
 import { withTranslation } from 'react-i18next';
 import { useParams } from 'react-router-dom';
 
@@ -39,12 +40,6 @@ const Technique = () => {
                };
        }, [name]);
 
-       useEffect(() => {
-               if (technique) {
-                       window.document.title = getTranslation(technique, 'title', i18n.language);
-               }
-       }, [technique, i18n.language]);
-
        if (loading) {
                return <Loading />;
        }
@@ -58,6 +53,10 @@ const Technique = () => {
        }
 
        return <ErrorBoundary>
+               <Helmet>
+                       <title>{getTranslation(technique, 'title', i18n.language)}</title>
+                       <meta name="description" content={getTranslation(technique, 'short', i18n.language)} />
+               </Helmet>
                <Detail technique={technique} />
        </ErrorBoundary>;
 };