basic image opener
This commit is contained in:
parent
fd97d589d4
commit
1ee9916970
@ -1,7 +1,7 @@
|
||||
|
||||
export default function getComponentForShare(contentType: string, filename: string) {
|
||||
if (contentType.startsWith("image/")) {
|
||||
return import("./opener/Default.svelte");
|
||||
return import("./opener/Image.svelte");
|
||||
}
|
||||
|
||||
if (contentType.startsWith("video/")) {
|
||||
@ -40,7 +40,7 @@ export default function getComponentForShare(contentType: string, filename: stri
|
||||
case "jpg":
|
||||
case "jpeg":
|
||||
case "gif":
|
||||
return import("./opener/Default.svelte");
|
||||
return import("./opener/Image.svelte");
|
||||
case "mp4":
|
||||
case "mov":
|
||||
case "avi":
|
||||
|
14
web/opener/Image.svelte
Normal file
14
web/opener/Image.svelte
Normal file
@ -0,0 +1,14 @@
|
||||
<script lang="ts">
|
||||
export let contentType: string;
|
||||
export let filename: string;
|
||||
export let slug: string;
|
||||
</script>
|
||||
|
||||
<img src="/s/{slug}" alt="shared" />
|
||||
|
||||
<style>
|
||||
img {
|
||||
max-width: 100%;
|
||||
height: auto;
|
||||
}
|
||||
</style>
|
Loading…
Reference in New Issue
Block a user