Skip to content

Commit

Permalink
make file, image viewer wide (#1444)
Browse files Browse the repository at this point in the history
  • Loading branch information
ajbura authored Oct 10, 2023
1 parent 5940cf2 commit d0f2a86
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
13 changes: 11 additions & 2 deletions src/app/organisms/room/message/FileContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import { bytesToSize } from '../../../utils/common';
import { TextViewer } from '../../../components/text-viewer';
import { READABLE_TEXT_MIME_TYPES } from '../../../utils/mimeTypes';
import { PdfViewer } from '../../../components/Pdf-viewer';
import * as css from './styles.css';

export type FileContentProps = {
body: string;
Expand Down Expand Up @@ -94,7 +95,11 @@ function ReadTextFile({ body, mimeType, url, encInfo }: Omit<FileContentProps, '
clickOutsideDeactivates: true,
}}
>
<Modal size="500" onContextMenu={(evt: any) => evt.stopPropagation()}>
<Modal
className={css.ModalWide}
size="500"
onContextMenu={(evt: any) => evt.stopPropagation()}
>
<TextViewer
name={body}
text={textState.data}
Expand Down Expand Up @@ -159,7 +164,11 @@ function ReadPdfFile({ body, mimeType, url, encInfo }: Omit<FileContentProps, 'i
clickOutsideDeactivates: true,
}}
>
<Modal size="500" onContextMenu={(evt: any) => evt.stopPropagation()}>
<Modal
className={css.ModalWide}
size="500"
onContextMenu={(evt: any) => evt.stopPropagation()}
>
<PdfViewer
name={body}
src={pdfState.data}
Expand Down
6 changes: 5 additions & 1 deletion src/app/organisms/room/message/ImageContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,11 @@ export const ImageContent = as<'div', ImageContentProps>(
clickOutsideDeactivates: true,
}}
>
<Modal size="500" onContextMenu={(evt: any) => evt.stopPropagation()}>
<Modal
className={css.ModalWide}
size="500"
onContextMenu={(evt: any) => evt.stopPropagation()}
>
<ImageViewer
src={srcState.data}
alt={body}
Expand Down
5 changes: 5 additions & 0 deletions src/app/organisms/room/message/styles.css.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export const AbsoluteFooter = style([
},
]);

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

export const MessageBase = style({
position: 'relative',
});
Expand Down

0 comments on commit d0f2a86

Please sign in to comment.