X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=resources%2Fjs%2Fcomponents%2Fcommon%2FZeldaIcon.js;fp=resources%2Fjs%2Fcomponents%2Fcommon%2FZeldaIcon.js;h=ef07b9207f3ecbc5bc0d9b28f76889b5be0a8495;hb=1811c6021240a95f505cc2d49f592dc1bf56ac89;hp=9194cde7fc2f58b250f2e021a58c47e59bde9910;hpb=6976d85a7117de53f7d42dee3de1f6b8fcb9726d;p=alttp.git diff --git a/resources/js/components/common/ZeldaIcon.js b/resources/js/components/common/ZeldaIcon.js index 9194cde..ef07b92 100644 --- a/resources/js/components/common/ZeldaIcon.js +++ b/resources/js/components/common/ZeldaIcon.js @@ -83,20 +83,21 @@ const getIconURL = name => { } }; -const ZeldaIcon = ({ name }) => { +const ZeldaIcon = ({ name, title }) => { const { t } = useTranslation(); const invert = name.startsWith('not-'); const strippedName = invert ? name.substr(4) : name; const src = getIconURL(strippedName); - const title = t(`icon.zelda.${name}`); + const alt = t(`icon.zelda.${name}`); + const realTitle = title !== '' ? title || alt : null; return {src ? {title} : null} {invert ? @@ -109,6 +110,7 @@ const ZeldaIcon = ({ name }) => { ZeldaIcon.propTypes = { name: PropTypes.string, + title: PropTypes.string, }; export default ZeldaIcon;