]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/techniques/Outline.js
lazy load some stuff
[alttp.git] / resources / js / components / techniques / Outline.js
index bf98eba37fd78da033d66cf943dccd4e9350c628..ae18aa8f46f9c9fce3c9be6ae43d6be5a2627f33 100644 (file)
@@ -1,6 +1,10 @@
 import PropTypes from 'prop-types';
 import React from 'react';
 import { ListGroup } from 'react-bootstrap';
+import { withTranslation } from 'react-i18next';
+
+import { getTranslation } from '../../helpers/Technique';
+import i18n from '../../i18n';
 
 const Outline = ({ technique }) => technique.chapters && technique.chapters.length ?
        <aside className="tech-outline mb-3 ms-3">
@@ -10,9 +14,9 @@ const Outline = ({ technique }) => technique.chapters && technique.chapters.leng
                                        action
                                        href={`#c${chapter.id}`}
                                        key={`c${chapter.id}`}
-                                       title={chapter.short || null}
+                                       title={getTranslation(chapter, 'short', i18n.language) || null}
                                >
-                                       {chapter.title}
+                                       {getTranslation(chapter, 'title', i18n.language)}
                                </ListGroup.Item>
                        : null)}
                </ListGroup>
@@ -26,4 +30,4 @@ Outline.propTypes = {
        }),
 };
 
-export default Outline;
+export default withTranslation()(Outline);