Revert "replace all require(.svg) with esm import" (#7969)
* Revert "replace all require(svgs) with esm import (#7948)"
This reverts commit 61cd463a3b
.
* add .default to svg icon inline requires
Signed-off-by: Kerry Archibald <kerrya@element.io>
* add shameful eslint ignore
Signed-off-by: Kerry Archibald <kerrya@element.io>
* format eslintrc
Signed-off-by: Kerry Archibald <kerrya@element.io>
* add missed MFileBody change
Signed-off-by: Kerry Archibald <kerrya@element.io>
* one more broken svg
Signed-off-by: Kerry Archibald <kerrya@element.io>
* and ignore it
Signed-off-by: Kerry Archibald <kerrya@element.io>
This commit is contained in:
parent
8a7ffb4f90
commit
d98a73b003
36 changed files with 119 additions and 131 deletions
|
@ -39,7 +39,6 @@ import ProgressBar from "../elements/ProgressBar";
|
|||
import DecoratedRoomAvatar from "../avatars/DecoratedRoomAvatar";
|
||||
import QueryMatcher from "../../../autocomplete/QueryMatcher";
|
||||
import LazyRenderList from "../elements/LazyRenderList";
|
||||
import WarningBadgeSvg from '../../../../res/img/element-icons/warning-badge.svg';
|
||||
|
||||
// These values match CSS
|
||||
const ROW_HEIGHT = 32 + 12;
|
||||
|
@ -214,7 +213,7 @@ export const AddExistingToSpace: React.FC<IAddExistingToSpaceProps> = ({
|
|||
if (error) {
|
||||
footer = <>
|
||||
<img
|
||||
src={WarningBadgeSvg}
|
||||
src={require("../../../../res/img/element-icons/warning-badge.svg").default}
|
||||
height="24"
|
||||
width="24"
|
||||
alt=""
|
||||
|
|
|
@ -44,7 +44,6 @@ import { inviteUsersToRoom } from "../../../RoomInvite";
|
|||
import ProgressBar from "../elements/ProgressBar";
|
||||
import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload";
|
||||
import { CreateEventField, IGroupRoom, IGroupSummary } from "../../../@types/groups";
|
||||
import WarningBadgeSvg from '../../../../res/img/element-icons/warning-badge.svg';
|
||||
|
||||
interface IProps {
|
||||
matrixClient: MatrixClient;
|
||||
|
@ -242,7 +241,7 @@ const CreateSpaceFromCommunityDialog: React.FC<IProps> = ({ matrixClient: cli, g
|
|||
let footer;
|
||||
if (error) {
|
||||
footer = <>
|
||||
<img src={WarningBadgeSvg} height="24" width="24" alt="" />
|
||||
<img src={require("../../../../res/img/element-icons/warning-badge.svg").default} height="24" width="24" alt="" />
|
||||
|
||||
<span className="mx_CreateSpaceFromCommunityDialog_error">
|
||||
<div className="mx_CreateSpaceFromCommunityDialog_errorHeading">{ _t("Failed to migrate community") }</div>
|
||||
|
|
|
@ -48,7 +48,6 @@ import { roomContextDetailsText } from "../../../Rooms";
|
|||
import { Action } from "../../../dispatcher/actions";
|
||||
import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload";
|
||||
import { ButtonEvent } from "../elements/AccessibleButton";
|
||||
import EllipsisSvg from '../../../../res/img/ellipsis.svg';
|
||||
|
||||
const AVATAR_SIZE = 30;
|
||||
|
||||
|
@ -217,7 +216,7 @@ const ForwardDialog: React.FC<IProps> = ({ matrixClient: cli, event, permalinkCr
|
|||
<EntityTile
|
||||
className="mx_EntityTile_ellipsis"
|
||||
avatarJsx={
|
||||
<BaseAvatar url={EllipsisSvg} name="..." width={36} height={36} />
|
||||
<BaseAvatar url={require("../../../../res/img/ellipsis.svg").default} name="..." width={36} height={36} />
|
||||
}
|
||||
name={text}
|
||||
presenceState="online"
|
||||
|
|
|
@ -72,9 +72,6 @@ import { ScreenName } from '../../../PosthogTrackers';
|
|||
import { ViewRoomPayload } from "../../../dispatcher/payloads/ViewRoomPayload";
|
||||
import { KeyBindingAction } from "../../../accessibility/KeyboardShortcuts";
|
||||
import { getKeyBindingsManager } from "../../../KeyBindingsManager";
|
||||
import EmailPillSvg from '../../../../res/img/icon-email-pill-avatar.svg';
|
||||
import PillRemoveSvg from '../../../../res/img/icon-pill-remove.svg';
|
||||
import InfoSvg from '../../../../res/img/element-icons/info.svg';
|
||||
|
||||
// we have a number of types defined from the Matrix spec which can't reasonably be altered here.
|
||||
/* eslint-disable camelcase */
|
||||
|
@ -198,7 +195,7 @@ class DMUserTile extends React.PureComponent<IDMUserTileProps> {
|
|||
const avatar = (this.props.member as ThreepidMember).isEmail
|
||||
? <img
|
||||
className='mx_InviteDialog_userTile_avatar mx_InviteDialog_userTile_threepidAvatar'
|
||||
src={EmailPillSvg}
|
||||
src={require("../../../../res/img/icon-email-pill-avatar.svg").default}
|
||||
width={avatarSize}
|
||||
height={avatarSize}
|
||||
/>
|
||||
|
@ -220,7 +217,7 @@ class DMUserTile extends React.PureComponent<IDMUserTileProps> {
|
|||
onClick={this.onRemove}
|
||||
>
|
||||
<img
|
||||
src={PillRemoveSvg}
|
||||
src={require("../../../../res/img/icon-pill-remove.svg").default}
|
||||
alt={_t('Remove')}
|
||||
width={8}
|
||||
height={8}
|
||||
|
@ -304,7 +301,7 @@ class DMRoomTile extends React.PureComponent<IDMRoomTileProps> {
|
|||
const avatarSize = 36;
|
||||
const avatar = (this.props.member as ThreepidMember).isEmail
|
||||
? <img
|
||||
src={EmailPillSvg}
|
||||
src={require("../../../../res/img/icon-email-pill-avatar.svg").default}
|
||||
width={avatarSize}
|
||||
height={avatarSize}
|
||||
/>
|
||||
|
@ -1475,7 +1472,7 @@ export default class InviteDialog extends React.PureComponent<IInviteDialogProps
|
|||
keySharingWarning =
|
||||
<p className='mx_InviteDialog_helpText'>
|
||||
<img
|
||||
src={InfoSvg}
|
||||
src={require("../../../../res/img/element-icons/info.svg").default}
|
||||
width={14}
|
||||
height={14} />
|
||||
{ " " + _t("Invited people will be able to read old messages.") }
|
||||
|
|
|
@ -42,7 +42,7 @@ import { ElementWidget } from "../../../stores/widgets/StopGapWidget";
|
|||
import { replaceableComponent } from "../../../utils/replaceableComponent";
|
||||
import { ELEMENT_CLIENT_ID } from "../../../identifiers";
|
||||
import SettingsStore from "../../../settings/SettingsStore";
|
||||
import WarningBadgeSvg from '../../../../res/img/element-icons/warning-badge.svg';
|
||||
|
||||
interface IProps {
|
||||
widgetDefinition: IModalWidgetOpenRequestData;
|
||||
widgetRoomId?: string;
|
||||
|
@ -187,7 +187,7 @@ export default class ModalWidgetDialog extends React.PureComponent<IProps, IStat
|
|||
>
|
||||
<div className="mx_ModalWidgetDialog_warning">
|
||||
<img
|
||||
src={WarningBadgeSvg}
|
||||
src={require("../../../../res/img/element-icons/warning-badge.svg").default}
|
||||
height="16"
|
||||
width="16"
|
||||
alt=""
|
||||
|
|
|
@ -23,7 +23,6 @@ import { replaceableComponent } from "../../../utils/replaceableComponent";
|
|||
import { getBlobSafeMimeType } from '../../../utils/blobs';
|
||||
import BaseDialog from "./BaseDialog";
|
||||
import DialogButtons from "../elements/DialogButtons";
|
||||
import FilesSvg from '../../../../res/img/feather-customised/files.svg';
|
||||
|
||||
interface IProps {
|
||||
file: File;
|
||||
|
@ -95,7 +94,7 @@ export default class UploadConfirmDialog extends React.Component<IProps> {
|
|||
preview = <div>
|
||||
<div>
|
||||
<img className="mx_UploadConfirmDialog_fileIcon"
|
||||
src={FilesSvg}
|
||||
src={require("../../../../res/img/feather-customised/files.svg").default}
|
||||
/>
|
||||
{ this.props.file.name } ({ filesize(this.props.file.size) })
|
||||
</div>
|
||||
|
|
|
@ -22,14 +22,12 @@ import { _t } from '../../../../languageHandler';
|
|||
import { SetupEncryptionStore, Phase } from '../../../../stores/SetupEncryptionStore';
|
||||
import { replaceableComponent } from "../../../../utils/replaceableComponent";
|
||||
import { IDialogProps } from "../IDialogProps";
|
||||
import VerifiedSvg from '../../../../../res/img/e2e/verified.svg';
|
||||
import WarningSvg from '../../../../../res/img/e2e/warning.svg';
|
||||
|
||||
function iconFromPhase(phase: Phase) {
|
||||
if (phase === Phase.Done) {
|
||||
return VerifiedSvg;
|
||||
return require("../../../../../res/img/e2e/verified.svg").default;
|
||||
} else {
|
||||
return WarningSvg;
|
||||
return require("../../../../../res/img/e2e/warning.svg").default;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue