mirror of
https://github.com/bulwarkmail/native.git
synced 2026-11-05 00:07:36 +00:00
fix: fit the files header under the status bar and clear of landscape insets
This commit is contained in:
@@ -54,6 +54,7 @@ import { downloadAttachment, shareAttachment } from '../lib/email-export';
|
|||||||
import { secureFetch } from '../lib/client-cert';
|
import { secureFetch } from '../lib/client-cert';
|
||||||
import { getUniqueName } from '../lib/filenode-name';
|
import { getUniqueName } from '../lib/filenode-name';
|
||||||
import { filesGridLayout } from '../lib/files-grid';
|
import { filesGridLayout } from '../lib/files-grid';
|
||||||
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
||||||
import { formatListDate } from '../lib/date-format';
|
import { formatListDate } from '../lib/date-format';
|
||||||
import { useLayout, useSheetInsets } from '../lib/use-layout';
|
import { useLayout, useSheetInsets } from '../lib/use-layout';
|
||||||
import { useBackWhileFocused } from '../lib/use-back-while-focused';
|
import { useBackWhileFocused } from '../lib/use-back-while-focused';
|
||||||
@@ -167,6 +168,14 @@ export default function FilesScreen() {
|
|||||||
const styles = React.useMemo(() => makeStyles(c), [c]);
|
const styles = React.useMemo(() => makeStyles(c), [c]);
|
||||||
const t = useLocaleStore((s) => s.t);
|
const t = useLocaleStore((s) => s.t);
|
||||||
const formatModified = useFormatModified();
|
const formatModified = useFormatModified();
|
||||||
|
// Clear of the status bar and, in landscape, the side insets; the header
|
||||||
|
// used a fixed 60 px top padding instead.
|
||||||
|
const insets = useSafeAreaInsets();
|
||||||
|
const headerInsets = {
|
||||||
|
paddingTop: insets.top + spacing.sm,
|
||||||
|
paddingLeft: spacing.md + insets.left,
|
||||||
|
paddingRight: spacing.md + insets.right,
|
||||||
|
};
|
||||||
|
|
||||||
// Folder navigation stack. Hierarchy is real parentId nesting (#379) — each
|
// Folder navigation stack. Hierarchy is real parentId nesting (#379) — each
|
||||||
// entry is the folder's node id (namespaced "accountId:nodeId" inside a
|
// entry is the folder's node id (namespaced "accountId:nodeId" inside a
|
||||||
@@ -674,7 +683,7 @@ export default function FilesScreen() {
|
|||||||
if (selectionMode) {
|
if (selectionMode) {
|
||||||
const selectedRows = visibleFiles.filter((r) => selection.has(r.id));
|
const selectedRows = visibleFiles.filter((r) => selection.has(r.id));
|
||||||
return (
|
return (
|
||||||
<View style={styles.header}>
|
<View style={[styles.header, headerInsets]}>
|
||||||
<View style={styles.headerRow}>
|
<View style={styles.headerRow}>
|
||||||
<Pressable
|
<Pressable
|
||||||
onPress={clearSelection}
|
onPress={clearSelection}
|
||||||
@@ -716,7 +725,7 @@ export default function FilesScreen() {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
return (
|
return (
|
||||||
<View style={styles.header}>
|
<View style={[styles.header, headerInsets]}>
|
||||||
<View style={styles.headerRow}>
|
<View style={styles.headerRow}>
|
||||||
<View style={styles.headerLeft}>
|
<View style={styles.headerLeft}>
|
||||||
{canBack ? (
|
{canBack ? (
|
||||||
@@ -1465,8 +1474,6 @@ function makeStyles(c: ThemePalette) {
|
|||||||
listColumn: { flex: 1 },
|
listColumn: { flex: 1 },
|
||||||
previewPane: { width: '45%', borderLeftWidth: 1, borderLeftColor: c.border },
|
previewPane: { width: '45%', borderLeftWidth: 1, borderLeftColor: c.border },
|
||||||
header: {
|
header: {
|
||||||
paddingTop: 60,
|
|
||||||
paddingHorizontal: spacing.md,
|
|
||||||
paddingBottom: spacing.sm,
|
paddingBottom: spacing.sm,
|
||||||
borderBottomWidth: 1,
|
borderBottomWidth: 1,
|
||||||
borderBottomColor: c.border,
|
borderBottomColor: c.border,
|
||||||
|
|||||||
Reference in New Issue
Block a user