Fix image/video size issue

This commit is contained in:
Lee 2022-11-14 04:02:47 +00:00
parent 7c5f636e7c
commit aa7369ce20
No known key found for this signature in database
GPG Key ID: 6EA25896ECCB3121

@ -46,20 +46,9 @@ export default function File(props) {
unoptimized unoptimized
></Image> ></Image>
); );
} else if (contentType.includes("video")) { }
if (contentType.includes("video")) {
toShow = <video alt={fileId} src={fileUrl} controls></video>; toShow = <video alt={fileId} src={fileUrl} controls></video>;
} else {
toShow = (
<Button
auto
className="bg-blue-600"
onPress={() => {
downloadURI(fileUrl, originalFileName);
}}
>
Download
</Button>
);
} }
} }
@ -75,7 +64,16 @@ export default function File(props) {
<h3>{formatBytes(size)}</h3> <h3>{formatBytes(size)}</h3>
</div> </div>
) : null} ) : null}
{toShow} <div className="md:w-4/6 md:h-4/6 sm:w-fit sm:h-fit">{toShow}</div>
<Button
auto
className="bg-blue-600 mt-5"
onPress={() => {
downloadURI(fileUrl, `${fileId}.${ext}`);
}}
>
Download
</Button>
</div> </div>
</div> </div>
); );