From 862932cce5adaf26c12965221c958d3b307d0fbc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Tue, 20 Jul 2021 18:48:18 +0200 Subject: [PATCH] Don't use require MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Šimon Brandner --- src/@types/svg.d.ts | 4 ++++ src/components/views/elements/AddressTile.tsx | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) create mode 100644 src/@types/svg.d.ts diff --git a/src/@types/svg.d.ts b/src/@types/svg.d.ts new file mode 100644 index 0000000000..156473a5c9 --- /dev/null +++ b/src/@types/svg.d.ts @@ -0,0 +1,4 @@ +declare module "*.svg" { + const content: any; + export default content; +} diff --git a/src/components/views/elements/AddressTile.tsx b/src/components/views/elements/AddressTile.tsx index 5f7535a82f..cdeb7cacd6 100644 --- a/src/components/views/elements/AddressTile.tsx +++ b/src/components/views/elements/AddressTile.tsx @@ -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 { 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({