Don't use require

Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
pull/21833/head
Šimon Brandner 2021-07-20 18:48:18 +02:00
parent c3399b110d
commit 862932cce5
No known key found for this signature in database
GPG Key ID: 55C211A1226CB17D
2 changed files with 6 additions and 2 deletions

4
src/@types/svg.d.ts vendored Normal file
View File

@ -0,0 +1,4 @@
declare module "*.svg" {
const content: any;
export default content;
}

View File

@ -22,6 +22,7 @@ import { replaceableComponent } from "../../../utils/replaceableComponent";
import { mediaFromMxc } from "../../../customisations/Media";
import { IUserAddress } from '../../../UserAddress';
import BaseAvatar from '../avatars/BaseAvatar';
import EmailUserIcon from "../../../../res/img/icon-email-user.svg";
interface IProps {
address: IUserAddress;
@ -49,8 +50,7 @@ export default class AddressTile extends React.Component<IProps> {
if (isMatrixAddress && address.avatarMxc) {
imgUrls.push(mediaFromMxc(address.avatarMxc).getSquareThumbnailHttp(25));
} else if (address.addressType === 'email') {
// eslint-disable-next-line @typescript-eslint/no-var-requires
imgUrls.push(require("../../../../res/img/icon-email-user.svg"));
imgUrls.push(EmailUserIcon);
}
const nameClasses = classNames({