replace all require(svgs) with esm import (#7948)
Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
522ad1aafb
commit
61cd463a3b
33 changed files with 104 additions and 54 deletions
|
@ -24,6 +24,7 @@ import { mediaFromMxc } from "../../../customisations/Media";
|
|||
import { IUserAddress } from '../../../UserAddress';
|
||||
import BaseAvatar from '../avatars/BaseAvatar';
|
||||
import EmailUserIcon from "../../../../res/img/icon-email-user.svg";
|
||||
import AddressDeleteSvg from '../../../../res/img/icon-address-delete.svg';
|
||||
|
||||
interface IProps {
|
||||
address: IUserAddress;
|
||||
|
@ -124,7 +125,7 @@ export default class AddressTile extends React.Component<IProps> {
|
|||
if (this.props.canDismiss) {
|
||||
dismiss = (
|
||||
<div className="mx_AddressTile_dismiss" onClick={this.props.onDismissed}>
|
||||
<img src={require("../../../../res/img/icon-address-delete.svg")} width="9" height="9" />
|
||||
<img src={AddressDeleteSvg} width="9" height="9" />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import React from 'react';
|
||||
|
||||
import WarningSvg from '../../../../res/img/warning.svg';
|
||||
|
||||
interface IProps {
|
||||
errorMsg?: string;
|
||||
}
|
||||
|
@ -8,7 +10,7 @@ const AppWarning: React.FC<IProps> = (props) => {
|
|||
return (
|
||||
<div className='mx_AppPermissionWarning'>
|
||||
<div className='mx_AppPermissionWarningImage'>
|
||||
<img src={require("../../../../res/img/warning.svg")} alt='' />
|
||||
<img src={WarningSvg} alt='' />
|
||||
</div>
|
||||
<div className='mx_AppPermissionWarningText'>
|
||||
<span className='mx_AppPermissionWarningTextLabel'>{ props.errorMsg || "Error" }</span>
|
||||
|
|
|
@ -25,6 +25,12 @@ import { _t } from "../../../languageHandler";
|
|||
import { IdentityProviderBrand, IIdentityProvider, ISSOFlow } from "../../../Login";
|
||||
import AccessibleTooltipButton from "./AccessibleTooltipButton";
|
||||
import { mediaFromMxc } from "../../../customisations/Media";
|
||||
import AppleSvg from '../../../../res/img/element-icons/brands/apple.svg';
|
||||
import FacebookSvg from '../../../../res/img/element-icons/brands/facebook.svg';
|
||||
import GithubSvg from '../../../../res/img/element-icons/brands/github.svg';
|
||||
import GitlabSvg from '../../../../res/img/element-icons/brands/gitlab.svg';
|
||||
import GoogleSvg from '../../../../res/img/element-icons/brands/google.svg';
|
||||
import TwitterSvg from '../../../../res/img/element-icons/brands/twitter.svg';
|
||||
|
||||
interface ISSOButtonProps extends Omit<IProps, "flow"> {
|
||||
idp: IIdentityProvider;
|
||||
|
@ -34,17 +40,17 @@ interface ISSOButtonProps extends Omit<IProps, "flow"> {
|
|||
const getIcon = (brand: IdentityProviderBrand | string) => {
|
||||
switch (brand) {
|
||||
case IdentityProviderBrand.Apple:
|
||||
return require(`../../../../res/img/element-icons/brands/apple.svg`);
|
||||
return AppleSvg;
|
||||
case IdentityProviderBrand.Facebook:
|
||||
return require(`../../../../res/img/element-icons/brands/facebook.svg`);
|
||||
return FacebookSvg;
|
||||
case IdentityProviderBrand.Github:
|
||||
return require(`../../../../res/img/element-icons/brands/github.svg`);
|
||||
return GithubSvg;
|
||||
case IdentityProviderBrand.Gitlab:
|
||||
return require(`../../../../res/img/element-icons/brands/gitlab.svg`);
|
||||
return GitlabSvg;
|
||||
case IdentityProviderBrand.Google:
|
||||
return require(`../../../../res/img/element-icons/brands/google.svg`);
|
||||
return GoogleSvg;
|
||||
case IdentityProviderBrand.Twitter:
|
||||
return require(`../../../../res/img/element-icons/brands/twitter.svg`);
|
||||
return TwitterSvg;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue