diff --git a/src/components/text/BitmapText.jsx b/src/components/text/BitmapText.jsx index 6fee920..8200fff 100644 --- a/src/components/text/BitmapText.jsx +++ b/src/components/text/BitmapText.jsx @@ -13,10 +13,17 @@ export function BitmapText(props) { throw new Error('The message.id must be contain 3 parts separated by dots'); } - const src = require(`emails/${parts[1]}/images/${props.intl.locale}/${parts[2]}.png`); - // TODO: we can improve this loader in future by adding an option to disable file emitting - // because this thing is handled by url-loader - const size = require(`image-size!emails/${parts[1]}/images/${props.intl.locale}/${parts[2]}.png`); + let src; + let size; + try { + src = require(`emails/${parts[1]}/images/${props.intl.locale}/${parts[2]}.png`); + // TODO: we can improve this loader in future by adding an option to disable file emitting + // because this thing is handled by url-loader + size = require(`image-size!emails/${parts[1]}/images/${props.intl.locale}/${parts[2]}.png`); + } catch (err) { // fallback to default locale + src = require(`emails/${parts[1]}/images/${props.intl.defaultLocale}/${parts[2]}.png`); + size = require(`image-size!emails/${parts[1]}/images/${props.intl.defaultLocale}/${parts[2]}.png`); + } const width = props.retina ? size.width / 2 : size.width; const height = props.retina ? size.height / 2 : size.height; @@ -26,7 +33,7 @@ export function BitmapText(props) { } ); @@ -39,11 +46,13 @@ BitmapText.propTypes = { id: PropTypes.string }) ]).isRequired, + style: PropTypes.object, // eslint-disable-line react/forbid-prop-types retina: PropTypes.bool }; BitmapText.defaultProps = { - retina: true + retina: true, + style: {} }; import { injectIntl, intlShape } from 'react-intl'; diff --git a/src/emails/register/Register.jsx b/src/emails/register/Register.jsx index 8135ddc..2415b0e 100644 --- a/src/emails/register/Register.jsx +++ b/src/emails/register/Register.jsx @@ -15,13 +15,6 @@ import violetManImage from './images/violetMan.png'; import orangeManImage from './images/orangeMan.png'; import darkBlueManImage from './images/darkBlueMan.png'; -import confirmEmailImage from './images/ru/confirmEmail.png'; -import whatsNextImage from './images/ru/whatsNext.png'; -import chooseYouSkin from './images/ru/chooseYouSkin.png'; -import installOurPatch from './images/ru/installOurPatch.png'; -import useTLauncher from './images/ru/useTlauncher.png'; -import footerLogoImage from './images/ru/footerLogo.png'; - export default function Register({username, link, code}) { return (