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
|
@ -20,27 +20,22 @@ import classNames from 'classnames';
|
|||
import { IApp } from "../../../stores/WidgetStore";
|
||||
import BaseAvatar, { BaseAvatarType } from "./BaseAvatar";
|
||||
import { mediaFromMxc } from "../../../customisations/Media";
|
||||
import DefaultAppSvg from '../../../../res/img/element-icons/room/default_app.svg';
|
||||
import DefaultVideoSvg from '../../../../res/img/element-icons/room/default_video.svg';
|
||||
import DefaultCalSvg from '../../../../res/img/element-icons/room/default_cal.svg';
|
||||
import DefaultDocSvg from '../../../../res/img/element-icons/room/default_doc.svg';
|
||||
import DefaultClockSvg from '../../../../res/img/element-icons/room/default_clock.svg';
|
||||
|
||||
interface IProps extends Omit<ComponentProps<BaseAvatarType>, "name" | "url" | "urls"> {
|
||||
app: IApp;
|
||||
}
|
||||
|
||||
const WidgetAvatar: React.FC<IProps> = ({ app, className, width = 20, height = 20, ...props }) => {
|
||||
let iconUrls = [DefaultAppSvg];
|
||||
let iconUrls = [require("../../../../res/img/element-icons/room/default_app.svg").default];
|
||||
// heuristics for some better icons until Widgets support their own icons
|
||||
if (app.type.includes("jitsi")) {
|
||||
iconUrls = [DefaultVideoSvg];
|
||||
iconUrls = [require("../../../../res/img/element-icons/room/default_video.svg").default];
|
||||
} else if (app.type.includes("meeting") || app.type.includes("calendar")) {
|
||||
iconUrls = [DefaultCalSvg];
|
||||
iconUrls = [require("../../../../res/img/element-icons/room/default_cal.svg").default];
|
||||
} else if (app.type.includes("pad") || app.type.includes("doc") || app.type.includes("calc")) {
|
||||
iconUrls = [DefaultDocSvg];
|
||||
iconUrls = [require("../../../../res/img/element-icons/room/default_doc.svg").default];
|
||||
} else if (app.type.includes("clock")) {
|
||||
iconUrls = [DefaultClockSvg];
|
||||
iconUrls = [require("../../../../res/img/element-icons/room/default_clock.svg").default];
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue