X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;ds=sidebyside;f=resources%2Fjs%2Fcomponents%2Fcommon%2FZeldaIcon.js;h=c53f4fd68def288ae2f231e11dc65b486796237f;hb=847969157063510460a48eba4bedfcce1caa7902;hp=84f2220672ce3e622031b96ea6064325df774ec8;hpb=2110d91bc5016fd78aec02578b09506b6d67f45e;p=alttp.git
diff --git a/resources/js/components/common/ZeldaIcon.js b/resources/js/components/common/ZeldaIcon.js
index 84f2220..c53f4fd 100644
--- a/resources/js/components/common/ZeldaIcon.js
+++ b/resources/js/components/common/ZeldaIcon.js
@@ -1,8 +1,8 @@
import PropTypes from 'prop-types';
import React from 'react';
-import { withTranslation } from 'react-i18next';
+import { useTranslation } from 'react-i18next';
-import i18n from '../../i18n';
+import Icon from './Icon';
const getIconURL = name => {
switch (name) {
@@ -64,17 +64,29 @@ const getIconURL = name => {
}
};
-const ZeldaIcon = ({ name }) =>
-
-
-;
+const ZeldaIcon = ({ name }) => {
+ const { t } = useTranslation();
+
+ const invert = name.startsWith('not-');
+ const strippedName = invert ? name.substr(4) : name;
+ const title = t(`icon.zelda.${name}`);
+
+ return
+
+ {invert ?
+
+
+
+ : null}
+ ;
+};
ZeldaIcon.propTypes = {
name: PropTypes.string,
};
-export default withTranslation()(ZeldaIcon);
+export default ZeldaIcon;