]> git.localhorst.tv Git - alttp.git/blobdiff - resources/js/components/common/ZeldaIcon.js
tech title icons
[alttp.git] / resources / js / components / common / ZeldaIcon.js
index c5da0b554cbc242322ea3f8c2ab0a2510c50a23f..9194cde7fc2f58b250f2e021a58c47e59bde9910 100644 (file)
@@ -74,6 +74,10 @@ const getIconURL = name => {
                case 'dungeon-tr':
                case 'dungeon-tt':
                        return `/dungeon/${name.substr(8)}.png`;
+               case 'crystal-switch':
+               case 'crystal-switch-blue':
+               case 'crystal-switch-red':
+                       return `/icon/${name}.png`;
                default:
                        return '';
        }
@@ -84,14 +88,17 @@ const ZeldaIcon = ({ name }) => {
 
        const invert = name.startsWith('not-');
        const strippedName = invert ? name.substr(4) : name;
+       const src = getIconURL(strippedName);
        const title = t(`icon.zelda.${name}`);
 
        return <span className="zelda-icon">
-               <img
-                       alt={title}
-                       src={getIconURL(strippedName)}
-                       title={title}
-               />
+               {src ?
+                       <img
+                               alt={title}
+                               src={src}
+                               title={title}
+                       />
+               : null}
                {invert ?
                        <span className="strike">
                                <Icon.SLASH title="" />