fix: FileModal scrollbars
This commit is contained in:
parent
c0d1b3d887
commit
bdf34bbbbf
2 changed files with 15 additions and 4 deletions
|
@ -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}
|
||||||
|
|
|
@ -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}
|
||||||
/>
|
/>
|
||||||
|
|
Loading…
Add table
Reference in a new issue