Skip to content

Commit 822c03e

Browse files
authored
Merge branch 'liteflow-labs:main' into main
2 parents c261245 + 4e44ddf commit 822c03e

1 file changed

Lines changed: 15 additions & 1 deletion

File tree

components/Token/Media.tsx

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ import { FC, useCallback, useEffect, useState } from 'react'
1212
import { AssetMedia } from '../../hooks/useDetectAssetMedia'
1313
import Image from '../Image/Image'
1414

15-
const supportedMedia = [/^image\/*/, /^video\/*/, /^application\/octet-stream$/]
15+
const supportedMedia = [
16+
/^image\/*/,
17+
/^video\/*/,
18+
/^application\/octet-stream$/,
19+
/^text\/html$/,
20+
]
1621

1722
const TokenMedia: FC<{
1823
media: AssetMedia
@@ -75,6 +80,15 @@ const TokenMedia: FC<{
7580
</>
7681
)
7782

83+
// display html
84+
if (mediaToDisplay.mimetype === 'text/html') {
85+
return (
86+
<Box position="relative" w="full" h="full">
87+
<iframe src={mediaToDisplay.url} width="100%" height="100%" />
88+
</Box>
89+
)
90+
}
91+
7892
// display video
7993
if (
8094
(mediaToDisplay.mimetype?.startsWith('video/') ||

0 commit comments

Comments
 (0)