fix: FileModal scrollbars

This commit is contained in:
diced 2023-03-21 19:31:45 -07:00
parent c0d1b3d887
commit bdf34bbbbf
No known key found for this signature in database
GPG key ID: 370BD1BA142842D1
2 changed files with 15 additions and 4 deletions

View file

@ -9,7 +9,7 @@ import {
Title,
Tooltip,
} from '@mantine/core';
import { useClipboard } from '@mantine/hooks';
import { useClipboard, useMediaQuery } from '@mantine/hooks';
import { showNotification } from '@mantine/notifications';
import {
IconAlarm,
@ -210,7 +210,13 @@ export default function FileModal({
};
return (
<Modal opened={open} onClose={() => setOpen(false)} title={<Title>{file.name}</Title>} size='xl'>
<Modal
opened={open}
onClose={() => setOpen(false)}
title={<Title>{file.name}</Title>}
size='auto'
fullScreen={useMediaQuery('(max-width: 600px)')}
>
<LoadingOverlay visible={loading} />
<Stack>
<Type
@ -218,8 +224,8 @@ export default function FileModal({
src={`/r/${encodeURI(file.name)}?compress=${compress}`}
alt={file.name}
popup
sx={{ minHeight: 200, overflowY: 'scroll', maxHeight: 500 }}
style={{ minHeight: 200, overflowY: 'scroll', maxHeight: 500 }}
sx={{ minHeight: 200 }}
style={{ minHeight: 200 }}
disableMediaPreview={false}
overrideRender={overrideRender}
setOverrideRender={setOverrideRender}

View file

@ -131,6 +131,11 @@ export default function Type({ file, popup = false, disableMediaPreview, ...prop
video: <video width='100%' autoPlay muted controls {...props} />,
image: (
<Image
styles={{
imageWrapper: {
position: 'inherit',
},
}}
placeholder={<PlaceholderContent Icon={IconPhotoCancel} text={'Image failed to load...'} />}
{...props}
/>