Skip to content

Commit

Permalink
extract wide modal styles
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbura committed Dec 7, 2024
1 parent 6fa0cfc commit f67fbd1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
6 changes: 3 additions & 3 deletions src/app/components/message/content/FileContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ import {
getFileNameExt,
mimeTypeToExt,
} from '../../../utils/mimeTypes';
import * as css from './style.css';
import { stopPropagation } from '../../../utils/keyboard';
import {
decryptFile,
Expand All @@ -36,6 +35,7 @@ import {
mxcUrlToHttp,
} from '../../../utils/matrix';
import { useMediaAuthentication } from '../../../hooks/useMediaAuthentication';
import { ModalWide } from '../../../styles/Modal.css';

const renderErrorButton = (retry: () => void, text: string) => (
<TooltipProvider
Expand Down Expand Up @@ -111,7 +111,7 @@ export function ReadTextFile({ body, mimeType, url, encInfo, renderViewer }: Rea
}}
>
<Modal
className={css.ModalWide}
className={ModalWide}
size="500"
onContextMenu={(evt: any) => evt.stopPropagation()}
>
Expand Down Expand Up @@ -199,7 +199,7 @@ export function ReadPdfFile({ body, mimeType, url, encInfo, renderViewer }: Read
}}
>
<Modal
className={css.ModalWide}
className={ModalWide}
size="500"
onContextMenu={(evt: any) => evt.stopPropagation()}
>
Expand Down
3 changes: 2 additions & 1 deletion src/app/components/message/content/ImageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import { FALLBACK_MIMETYPE } from '../../../utils/mimeTypes';
import { stopPropagation } from '../../../utils/keyboard';
import { decryptFile, downloadEncryptedMedia, mxcUrlToHttp } from '../../../utils/matrix';
import { useMediaAuthentication } from '../../../hooks/useMediaAuthentication';
import { ModalWide } from '../../../styles/Modal.css';

type RenderViewerProps = {
src: string;
Expand Down Expand Up @@ -121,7 +122,7 @@ export const ImageContent = as<'div', ImageContentProps>(
}}
>
<Modal
className={css.ModalWide}
className={ModalWide}
size="500"
onContextMenu={(evt: any) => evt.stopPropagation()}
>
Expand Down
5 changes: 0 additions & 5 deletions src/app/components/message/content/style.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,3 @@ export const AbsoluteFooter = style([
right: config.space.S100,
},
]);

export const ModalWide = style({
minWidth: '85vw',
minHeight: '90vh',
});
6 changes: 6 additions & 0 deletions src/app/styles/Modal.css.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { style } from '@vanilla-extract/css';

export const ModalWide = style({
minWidth: '85vw',
minHeight: '90vh',
});

0 comments on commit f67fbd1

Please sign in to comment.