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, Title,
Tooltip, Tooltip,
} from '@mantine/core'; } from '@mantine/core';
import { useClipboard } from '@mantine/hooks'; import { useClipboard, useMediaQuery } from '@mantine/hooks';
import { showNotification } from '@mantine/notifications'; import { showNotification } from '@mantine/notifications';
import { import {
IconAlarm, IconAlarm,
@ -210,7 +210,13 @@ export default function FileModal({
}; };
return ( 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} /> <LoadingOverlay visible={loading} />
<Stack> <Stack>
<Type <Type
@ -218,8 +224,8 @@ export default function FileModal({
src={`/r/${encodeURI(file.name)}?compress=${compress}`} src={`/r/${encodeURI(file.name)}?compress=${compress}`}
alt={file.name} alt={file.name}
popup popup
sx={{ minHeight: 200, overflowY: 'scroll', maxHeight: 500 }} sx={{ minHeight: 200 }}
style={{ minHeight: 200, overflowY: 'scroll', maxHeight: 500 }} style={{ minHeight: 200 }}
disableMediaPreview={false} disableMediaPreview={false}
overrideRender={overrideRender} overrideRender={overrideRender}
setOverrideRender={setOverrideRender} 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} />, video: <video width='100%' autoPlay muted controls {...props} />,
image: ( image: (
<Image <Image
styles={{
imageWrapper: {
position: 'inherit',
},
}}
placeholder={<PlaceholderContent Icon={IconPhotoCancel} text={'Image failed to load...'} />} placeholder={<PlaceholderContent Icon={IconPhotoCancel} text={'Image failed to load...'} />}
{...props} {...props}
/> />