diff --git a/client/src/mobile/screens/trip/tabs/MFilesBoard.tsx b/client/src/mobile/screens/trip/tabs/MFilesBoard.tsx index 6fced702e..b75532b5c 100644 --- a/client/src/mobile/screens/trip/tabs/MFilesBoard.tsx +++ b/client/src/mobile/screens/trip/tabs/MFilesBoard.tsx @@ -123,7 +123,10 @@ export function FileTile({ file, selected, canStar, onPick, onStar, onMenu, t }: )} - + {file.original_name} @@ -166,7 +169,10 @@ export function FileTile({ file, selected, canStar, onPick, onStar, onMenu, t }: function Badge({ children }: { children: ReactNode }) { return ( // A size, a date or a name, each in its own direction ("46.1 KB" stays so in Arabic). - + {children} ); @@ -181,6 +187,43 @@ interface FilePreviewPaneProps { onMenu: () => void; } +/** The pane's heading: the type's tile when nothing is shown in place, the name, and what the file is. */ +function FileHeading({ file, shownInPlace }: { file: TripFile; shownInPlace: boolean }) { + const { locale } = useTranslation(); + const meta = getFileTypeMeta(file); + return ( +
+ {!shownInPlace && ( + + + + )} +
+

+ {file.original_name} +

+
+ + {meta.label} + + {isWalletPass(file.mime_type, file.original_name) && ( + + + )} + {!!file.file_size && {formatSize(file.file_size)}} + {formatFileDate(file.created_at, locale)} + {file.uploaded_by_name && {file.uploaded_by_name}} +
+
+
+ ); +} + /** * The file picked in the grid, shown beside it once the window has room for * two panes, the way Files on an iPad previews a document: the picture or the @@ -191,8 +234,6 @@ interface FilePreviewPaneProps { */ export function FilePreviewPane({ file, planner, onOpen, onStar, onLinks, onMenu }: FilePreviewPaneProps) { const { t } = planner; - const { locale } = useTranslation(); - const meta = getFileTypeMeta(file); const image = isImage(file.mime_type); const pdf = isPdf(file) && pdfInPage(); const src = useSignedUrl(file.url, image || pdf); @@ -229,35 +270,7 @@ export function FilePreviewPane({ file, planner, onOpen, onStar, onLinks, onMenu )} -
- {!shownInPlace && ( - - - - )} -
-

- {file.original_name} -

-
- - {meta.label} - - {isWalletPass(file.mime_type, file.original_name) && ( - - - )} - {!!file.file_size && {formatSize(file.file_size)}} - {formatFileDate(file.created_at, locale)} - {file.uploaded_by_name && {file.uploaded_by_name}} -
-
-
+ {(linked.places.length > 0 || linked.reservations.length > 0 || file.note_id != null) && (