]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/pages/Map.js
store map position in history
[alttp.git] / resources / js / components / pages / Map.js
index 44ac0a05f5a441e8ecd368ec1cb2a81b1a4b3590..3cbd31f6025367f1bb98f3d16f3adc7e8f245cb2 100644 (file)
@@ -1,27 +1,38 @@
 import React from 'react';
 import { Container } from 'react-bootstrap';
+import { Helmet } from 'react-helmet';
 import { useTranslation } from 'react-i18next';
+import { useParams } from 'react-router';
 
+import CanonicalLinks from '../common/CanonicalLinks';
 import Buttons from '../map/Buttons';
+import List from '../map/List';
 import OpenSeadragon from '../map/OpenSeadragon';
 import Pins from '../map/Pins';
+import UWSuperTiles from '../map/UWSuperTiles';
 
 const Map = () => {
+       const [uwOverlay, setUWOverlay] = React.useState(false);
+
+       const { activeMap } = useParams();
        const container = React.useRef();
        const { t } = useTranslation();
 
-       React.useEffect(() => {
-               window.document.title = t('map.heading');
-       }, []);
-
        return <Container fluid>
+               <Helmet>
+                       <title>{t('map.heading')}</title>
+                       <meta name="description" content={t('map.description')} />
+               </Helmet>
+               <CanonicalLinks base={`/map/${activeMap}`} />
                <OpenSeadragon ref={container}>
-                       <div className="d-flex align-items-center justify-content-between">
+                       <div className="d-flex align-items-start justify-content-between">
                                <h1>{t('map.heading')}</h1>
-                               <Buttons />
+                               <Buttons setUWOverlay={setUWOverlay} uwOverlay={uwOverlay} />
                        </div>
                        <div ref={container} style={{ height: '80vh' }} />
                        <Pins />
+                       <UWSuperTiles show={uwOverlay} />
+                       <List />
                </OpenSeadragon>
        </Container>;
 };