]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/pages/Techniques.js
add helmet
[alttp.git] / resources / js / components / pages / Techniques.js
index ddecf5603e7752130588f2edad28fe90d9db3ebe..a89c3a252e01f560449110a2739217b2487e6d70 100644 (file)
@@ -1,6 +1,7 @@
 import axios from 'axios';
 import PropTypes from 'prop-types';
 import React from 'react';
+import { Helmet } from 'react-helmet';
 import { withTranslation } from 'react-i18next';
 
 import NotFound from './NotFound';
@@ -36,7 +37,6 @@ const Techniques = ({ namespace, type }) => {
                if (!techniques.length) {
                        setLoading(true);
                }
-               window.document.title = i18n.t(`${namespace}.heading`);
                axios
                        .get(`/api/content`, {
                                params: {
@@ -63,7 +63,6 @@ const Techniques = ({ namespace, type }) => {
        }, [filter, namespace, type]);
 
        React.useEffect(() => {
-               window.document.title = i18n.t(`${namespace}.heading`);
                setTechniques(t => [...t].sort(compareTranslation('title', i18n.language)));
        }, [namespace, i18n.language]);
 
@@ -80,6 +79,10 @@ const Techniques = ({ namespace, type }) => {
        }
 
        return <ErrorBoundary>
+               <Helmet>
+                       <title>{i18n.t(`${namespace}.heading`)}</title>
+                       <meta name="description" content={i18n.t(`${namespace}.description`)} />
+               </Helmet>
                <Overview
                        filter={filter}
                        namespace={namespace}