X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fpages%2FTechniques.js;h=c2d7aec80627aaec51f6344d113ecbfccb55530d;hb=7c6716036321ba09846785720e81459aad55a323;hp=ddecf5603e7752130588f2edad28fe90d9db3ebe;hpb=2c5535946aa15278c6e969c9a9b24d32a45e5b12;p=alttp.git diff --git a/resources/js/components/pages/Techniques.js b/resources/js/components/pages/Techniques.js index ddecf56..c2d7aec 100644 --- a/resources/js/components/pages/Techniques.js +++ b/resources/js/components/pages/Techniques.js @@ -1,9 +1,11 @@ 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'; +import CanonicalLinks from '../common/CanonicalLinks'; import ErrorBoundary from '../common/ErrorBoundary'; import ErrorMessage from '../common/ErrorMessage'; import Loading from '../common/Loading'; @@ -36,13 +38,9 @@ const Techniques = ({ namespace, type }) => { if (!techniques.length) { setLoading(true); } - window.document.title = i18n.t(`${namespace}.heading`); axios - .get(`/api/content`, { - params: { - type, - ...filter, - }, + .get(`/api/pages/${type}`, { + params: filter, signal: ctrl.signal }) .then(response => { @@ -63,7 +61,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 +77,11 @@ const Techniques = ({ namespace, type }) => { } return + + {i18n.t(`${namespace}.heading`)} + + +