GeezerVison is showing github.com — fix(mobile): keep the partial file warning below the iPad navigation … · patroza/t3code@8213d1d
File tree
Expand file treeCollapse file tree
Open diff view settings
apps/mobile/src/features/files
Expand file treeCollapse file tree
Open diff view settings
Collapse file
Copy file name to clipboardExpand all lines: apps/mobile/src/features/files/AttachmentDocumentBody.tsx +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -3,6 +3,7 @@ import { useGT } from "gt-react-native"; |
3 | 3 | import { View } from "react-native"; |
4 | 4 |
|
5 | 5 | import { EmptyState } from "../../components/ui/EmptyState"; |
| 6 | +import { useContentTopInset } from "../../components/ui/useBarInset"; |
6 | 7 | import type { useAttachmentDocument } from "../../lib/attachmentDocument"; |
7 | 8 | import { HtmlRenderWebView } from "../threads/HtmlRenderWebView"; |
8 | 9 | import { AudioFilePreview } from "./AudioFilePreview"; |
@@ -41,6 +42,7 @@ export function AttachmentDocumentBody(props: { |
41 | 42 | }) { |
42 | 43 | const { document } = props; |
43 | 44 | const gt = useGT(); |
| 45 | + const headerInset = useContentTopInset(); |
44 | 46 | if (document.error) { |
45 | 47 | return ( |
46 | 48 | <View className="flex-1 items-center justify-center bg-sheet px-6"> |
@@ -63,7 +65,7 @@ export function AttachmentDocumentBody(props: { |
63 | 65 | if (document.needsText && document.content) { |
64 | 66 | const { content, table } = document; |
65 | 67 | return ( |
66 | | - <View className="flex-1 bg-sheet"> |
| 68 | + <View className="flex-1 bg-sheet" style={{ paddingTop: content.truncated ? headerInset : 0 }}> |
67 | 69 | {content.truncated ? ( |
68 | 70 | <FilePreviewNotice title={gt("Partial file")}> |
69 | 71 | {gt("Preview limited to the first 1 MB. Save or share the file to read it in full.")} |
|