Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions packages/shared-components/src/@types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,15 @@ declare module "*.png" {
const content: string;
export default content;
}

// For importing animated GIFs for use in testing
declare module "*.gif" {
const content: string;
export default content;
Comment thread
Half-Shot marked this conversation as resolved.
Outdated
}

// For importing videos for use in testing
declare module "*.webm" {
const content: string;
export default content;
}
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,9 @@
type ImageBodyViewActions,
type ImageBodyViewSnapshot,
} from "./ImageBodyView";

const imageSrc = new URL("../../../../../../static/image-body/install-spinner.png", import.meta.url).href;
const thumbnailSrc = new URL("../../../../../../static/image-body/install-spinner.png", import.meta.url).href;
const animatedGifSrc = new URL("../../../../../../static/image-body/install-spinner.gif", import.meta.url).href;
import imageSrc from "../../../../../../static/image-body/install-spinner.png";

Check warning on line 21 in packages/shared-components/src/room/timeline/event-tile/body/MImageBodyView/ImageBodyView.stories.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

'/home/runner/work/element-web/element-web/packages/shared-components/static/image-body/install-spinner.png' imported multiple times.

See more on https://sonarcloud.io/project/issues?id=element-web&issues=AZ2-fuUR1EVPJuqYy1wr&open=AZ2-fuUR1EVPJuqYy1wr&pullRequest=33289
import thumbnailSrc from "../../../../../../static/image-body/install-spinner.png";

Check warning on line 22 in packages/shared-components/src/room/timeline/event-tile/body/MImageBodyView/ImageBodyView.stories.tsx

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

'/home/runner/work/element-web/element-web/packages/shared-components/static/image-body/install-spinner.png' imported multiple times.

See more on https://sonarcloud.io/project/issues?id=element-web&issues=AZ2-fuUR1EVPJuqYy1ws&open=AZ2-fuUR1EVPJuqYy1ws&pullRequest=33289
import animatedGifSrc from "../../../../../../static/image-body/install-spinner.gif";
const demoBlurhash = "LEHV6nWB2yk8pyo0adR*.7kCMdnj";
const imageBodyViewStateOptions = [ImageBodyViewState.ERROR, ImageBodyViewState.HIDDEN, ImageBodyViewState.READY];
const imageBodyViewPlaceholderOptions = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ exports[`ImageBodyView > matches snapshot for animated-preview story 1`] = `
>
<a
class="ImageBodyView-module_link"
href="http://localhost:63315/static/image-body/install-spinner.gif"
href="/static/image-body/install-spinner.gif"
>
<div
class="ImageBodyView-module_thumbnailContainer"
Expand All @@ -19,7 +19,7 @@ exports[`ImageBodyView > matches snapshot for animated-preview story 1`] = `
<img
alt="Element logo"
class="ImageBodyView-module_image"
src="http://localhost:63315/static/image-body/install-spinner.png"
src="/static/image-body/install-spinner.png"
/>
<p
class="ImageBodyView-module_gifLabel"
Expand All @@ -43,7 +43,7 @@ exports[`ImageBodyView > matches snapshot for default story 1`] = `
>
<a
class="ImageBodyView-module_link"
href="http://localhost:63315/static/image-body/install-spinner.png"
href="/static/image-body/install-spinner.png"
>
<div
class="ImageBodyView-module_thumbnailContainer"
Expand All @@ -55,7 +55,7 @@ exports[`ImageBodyView > matches snapshot for default story 1`] = `
<img
alt="Element logo"
class="ImageBodyView-module_image"
src="http://localhost:63315/static/image-body/install-spinner.png"
src="/static/image-body/install-spinner.png"
/>
</div>
</div>
Expand Down Expand Up @@ -147,7 +147,7 @@ exports[`ImageBodyView > matches snapshot for loading-with-blurhash story 1`] =
>
<a
class="ImageBodyView-module_link"
href="http://localhost:63315/static/image-body/install-spinner.png"
href="/static/image-body/install-spinner.png"
>
<div
class="ImageBodyView-module_thumbnailContainer"
Expand All @@ -173,7 +173,7 @@ exports[`ImageBodyView > matches snapshot for loading-with-blurhash story 1`] =
<img
alt="Element logo"
class="ImageBodyView-module_image"
src="http://localhost:63315/static/image-body/install-spinner.png"
src="/static/image-body/install-spinner.png"
/>
</div>
</div>
Expand All @@ -192,7 +192,7 @@ exports[`ImageBodyView > matches snapshot for loading-with-spinner story 1`] = `
>
<a
class="ImageBodyView-module_link"
href="http://localhost:63315/static/image-body/install-spinner.png"
href="/static/image-body/install-spinner.png"
>
<div
class="ImageBodyView-module_thumbnailContainer"
Expand Down Expand Up @@ -225,7 +225,7 @@ exports[`ImageBodyView > matches snapshot for loading-with-spinner story 1`] = `
<img
alt="Element logo"
class="ImageBodyView-module_image"
src="http://localhost:63315/static/image-body/install-spinner.png"
src="/static/image-body/install-spinner.png"
/>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ import {
} from "./VideoBodyView";
import { useMockedViewModel } from "../../../../../core/viewmodel/useMockedViewModel";
import { withViewDocs } from "../../../../../../.storybook/withViewDocs";

const demoVideo = new URL("../../../../../../static/videoBodyDemo.webm", import.meta.url).href;
import demoVideo from "../../../../../../static/videoBodyDemo.webm";

type VideoBodyViewProps = VideoBodyViewSnapshot &
VideoBodyViewActions & {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ exports[`VideoBodyView > matches snapshot for ready story 1`] = `
crossorigin="anonymous"
poster="/static/element.png"
preload="none"
src="http://localhost:63315/static/videoBodyDemo.webm"
src="/static/videoBodyDemo.webm"
/>
</div>
<div>
Expand Down
Loading