@oxyhq/services 22.6.2 → 22.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js +99 -77
- package/lib/commonjs/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +33 -40
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js +92 -88
- package/lib/commonjs/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +175 -360
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js +9 -2
- package/lib/commonjs/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileViewer.js +100 -78
- package/lib/module/ui/components/fileManagement/FileViewer.js.map +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js +34 -41
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js +94 -90
- package/lib/module/ui/components/photogrid/JustifiedPhotoGrid.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +177 -363
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js +9 -2
- package/lib/module/ui/screens/fileManagement/PhotoPickerSection.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts +0 -1
- package/lib/typescript/commonjs/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileViewer.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts +0 -1
- package/lib/typescript/module/ui/components/photogrid/JustifiedPhotoGrid.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/fileManagement/PhotoPickerSection.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/ui/components/fileManagement/FileViewer.tsx +82 -68
- package/src/ui/components/fileManagement/UploadPreview.tsx +34 -29
- package/src/ui/components/photogrid/JustifiedPhotoGrid.tsx +14 -13
- package/src/ui/screens/FileManagementScreen.tsx +135 -354
- package/src/ui/screens/fileManagement/PhotoPickerSection.tsx +6 -2
- package/lib/commonjs/ui/components/fileManagement/styles.js +0 -832
- package/lib/commonjs/ui/components/fileManagement/styles.js.map +0 -1
- package/lib/module/ui/components/fileManagement/styles.js +0 -828
- package/lib/module/ui/components/fileManagement/styles.js.map +0 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/styles.d.ts +0 -825
- package/lib/typescript/commonjs/ui/components/fileManagement/styles.d.ts.map +0 -1
- package/lib/typescript/module/ui/components/fileManagement/styles.d.ts +0 -825
- package/lib/typescript/module/ui/components/fileManagement/styles.d.ts.map +0 -1
- package/src/ui/components/fileManagement/styles.ts +0 -823
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
import React, { useState, useEffect, useCallback, useMemo, useRef } from 'react';
|
|
4
|
-
import { View, Text, TouchableOpacity, StyleSheet, ScrollView, ActivityIndicator, RefreshControl, TextInput, Image, Animated, Easing, AccessibilityInfo } from 'react-native';
|
|
4
|
+
import { View, Text, TouchableOpacity, StyleSheet, ScrollView, ActivityIndicator, RefreshControl, TextInput, Image, Animated, Easing, AccessibilityInfo, Platform, useWindowDimensions } from 'react-native';
|
|
5
5
|
import { Image as ExpoImage } from 'expo-image';
|
|
6
6
|
import { Dialog, toast, useDialogControl } from '@oxyhq/bloom';
|
|
7
7
|
import { Ionicons, MaterialCommunityIcons } from '@expo/vector-icons';
|
|
@@ -17,15 +17,39 @@ import { useResolvedFileUrls, fileThumbSource } from "../hooks/useResolvedFileUr
|
|
|
17
17
|
import { FileViewer } from "../components/fileManagement/FileViewer.js";
|
|
18
18
|
import { FileDetailsModal } from "../components/fileManagement/FileDetailsModal.js";
|
|
19
19
|
import { UploadPreview } from "../components/fileManagement/UploadPreview.js";
|
|
20
|
-
import { fileManagementStyles } from "../components/fileManagement/styles.js";
|
|
21
20
|
import { getErrorMessage } from "./fileManagement/shared.js";
|
|
22
21
|
import { useFileUploadState } from "./fileManagement/hooks/useFileUploadState.js";
|
|
23
22
|
import PhotoPickerView from "./fileManagement/PhotoPickerSection.js";
|
|
24
23
|
import FileListSection from "./fileManagement/FileListSection.js";
|
|
25
24
|
import UploadBar from "./fileManagement/UploadBar.js";
|
|
26
25
|
|
|
27
|
-
//
|
|
26
|
+
// Genuinely-inline-only styles: `viewModeButton` is spread into an Animated.View
|
|
27
|
+
// style array (interpolated backgroundColor), and the photo tiles are
|
|
28
|
+
// `expo-image` (no className remap). Everything else uses NativeWind classNames.
|
|
28
29
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
30
|
+
const screenStyles = StyleSheet.create({
|
|
31
|
+
viewModeButton: {
|
|
32
|
+
paddingHorizontal: 10,
|
|
33
|
+
paddingVertical: 6,
|
|
34
|
+
borderRadius: 999,
|
|
35
|
+
minWidth: 36,
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
marginHorizontal: 1
|
|
39
|
+
},
|
|
40
|
+
photoImage: {
|
|
41
|
+
width: '100%',
|
|
42
|
+
height: '100%',
|
|
43
|
+
borderRadius: 8
|
|
44
|
+
},
|
|
45
|
+
justifiedPhotoImage: {
|
|
46
|
+
width: '100%',
|
|
47
|
+
height: '100%',
|
|
48
|
+
borderRadius: 6
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
// Animated button component for smooth transitions
|
|
29
53
|
const AnimatedButton = ({
|
|
30
54
|
isSelected,
|
|
31
55
|
onPress,
|
|
@@ -76,8 +100,7 @@ const FileManagementScreen = ({
|
|
|
76
100
|
goBack,
|
|
77
101
|
navigate,
|
|
78
102
|
userId,
|
|
79
|
-
containerWidth
|
|
80
|
-
// Fallback for when not provided by the router
|
|
103
|
+
containerWidth,
|
|
81
104
|
selectMode = false,
|
|
82
105
|
multiSelect = false,
|
|
83
106
|
onSelect,
|
|
@@ -108,8 +131,12 @@ const FileManagementScreen = ({
|
|
|
108
131
|
const visibilityChangeDialog = useDialogControl();
|
|
109
132
|
const [pendingDeleteFile, setPendingDeleteFile] = useState(null);
|
|
110
133
|
const files = useFiles();
|
|
111
|
-
|
|
112
|
-
|
|
134
|
+
const {
|
|
135
|
+
width: windowWidth
|
|
136
|
+
} = useWindowDimensions();
|
|
137
|
+
// Prefer an explicit sheet width from the router; fall back to the window
|
|
138
|
+
// so photo grids never size against a hardcoded 400px default.
|
|
139
|
+
const safeContainerWidth = typeof containerWidth === 'number' && containerWidth > 0 ? containerWidth : windowWidth;
|
|
113
140
|
const uploading = useUploadingStore();
|
|
114
141
|
const uploadProgress = useUploadAggregateProgress();
|
|
115
142
|
const deleting = useDeletingStore();
|
|
@@ -738,60 +765,11 @@ const FileManagementScreen = ({
|
|
|
738
765
|
setSelectedFile(file);
|
|
739
766
|
fileDetailsControl.open();
|
|
740
767
|
};
|
|
741
|
-
const renderSimplePhotoItem = useCallback((photo, index) => {
|
|
742
|
-
const downloadUrl = thumbSourceFor(photo);
|
|
743
|
-
|
|
744
|
-
// Calculate photo item width based on actual container size from bottom sheet
|
|
745
|
-
let itemsPerRow = 3; // Default for mobile
|
|
746
|
-
if (safeContainerWidth > 768) itemsPerRow = 4; // Desktop/tablet
|
|
747
|
-
else if (safeContainerWidth > 480) itemsPerRow = 3; // Large mobile
|
|
748
|
-
|
|
749
|
-
// Account for the photoScrollContainer padding (16px on each side = 32px total)
|
|
750
|
-
const scrollContainerPadding = 32; // Total horizontal padding from photoScrollContainer
|
|
751
|
-
const gaps = (itemsPerRow - 1) * 4; // Gap between items (4px)
|
|
752
|
-
const availableWidth = safeContainerWidth - scrollContainerPadding;
|
|
753
|
-
const itemWidth = (availableWidth - gaps) / itemsPerRow;
|
|
754
|
-
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
755
|
-
style: [fileManagementStyles.simplePhotoItem, {
|
|
756
|
-
width: itemWidth,
|
|
757
|
-
height: itemWidth,
|
|
758
|
-
marginRight: (index + 1) % itemsPerRow === 0 ? 0 : 4,
|
|
759
|
-
...(selectMode && selectedIds.has(photo.id) ? {
|
|
760
|
-
borderWidth: 2,
|
|
761
|
-
borderColor: colors.primary
|
|
762
|
-
} : {})
|
|
763
|
-
}],
|
|
764
|
-
onPress: () => handleFileOpen(photo),
|
|
765
|
-
activeOpacity: 0.8,
|
|
766
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
767
|
-
style: fileManagementStyles.simplePhotoContainer,
|
|
768
|
-
children: [/*#__PURE__*/_jsx(ExpoImage, {
|
|
769
|
-
source: {
|
|
770
|
-
uri: downloadUrl
|
|
771
|
-
},
|
|
772
|
-
style: fileManagementStyles.simplePhotoImage,
|
|
773
|
-
contentFit: "cover",
|
|
774
|
-
transition: 120,
|
|
775
|
-
cachePolicy: "memory-disk",
|
|
776
|
-
onError: () => {
|
|
777
|
-
// Photo failed to load, will show placeholder
|
|
778
|
-
},
|
|
779
|
-
accessibilityLabel: photo.filename
|
|
780
|
-
}), selectMode && /*#__PURE__*/_jsx(View, {
|
|
781
|
-
style: fileManagementStyles.selectionBadge,
|
|
782
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
783
|
-
name: selectedIds.has(photo.id) ? 'checkmark-circle' : 'ellipse-outline',
|
|
784
|
-
size: 20,
|
|
785
|
-
color: selectedIds.has(photo.id) ? colors.primary : colors.text
|
|
786
|
-
})
|
|
787
|
-
})]
|
|
788
|
-
})
|
|
789
|
-
}, photo.id);
|
|
790
|
-
}, [thumbSourceFor, safeContainerWidth, selectMode, selectedIds, colors.primary, colors.text]);
|
|
791
768
|
const renderJustifiedPhotoItem = useCallback((photo, width, height, isLast) => {
|
|
792
769
|
const downloadUrl = thumbSourceFor(photo);
|
|
793
770
|
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
794
|
-
|
|
771
|
+
className: "rounded-[6px] overflow-hidden relative",
|
|
772
|
+
style: {
|
|
795
773
|
width,
|
|
796
774
|
height,
|
|
797
775
|
...(selectMode && selectedIds.has(photo.id) ? {
|
|
@@ -801,16 +779,16 @@ const FileManagementScreen = ({
|
|
|
801
779
|
...(selectMode && multiSelect && selectedIds.size > 0 && !selectedIds.has(photo.id) ? {
|
|
802
780
|
opacity: 0.4
|
|
803
781
|
} : {})
|
|
804
|
-
}
|
|
782
|
+
},
|
|
805
783
|
onPress: () => handleFileOpen(photo),
|
|
806
784
|
activeOpacity: 0.8,
|
|
807
785
|
children: /*#__PURE__*/_jsxs(View, {
|
|
808
|
-
|
|
786
|
+
className: "w-full h-full relative rounded-[6px] overflow-hidden",
|
|
809
787
|
children: [/*#__PURE__*/_jsx(ExpoImage, {
|
|
810
788
|
source: {
|
|
811
789
|
uri: downloadUrl
|
|
812
790
|
},
|
|
813
|
-
style:
|
|
791
|
+
style: screenStyles.justifiedPhotoImage,
|
|
814
792
|
contentFit: "cover",
|
|
815
793
|
transition: 120,
|
|
816
794
|
cachePolicy: "memory-disk",
|
|
@@ -819,7 +797,10 @@ const FileManagementScreen = ({
|
|
|
819
797
|
},
|
|
820
798
|
accessibilityLabel: photo.filename
|
|
821
799
|
}), selectMode && /*#__PURE__*/_jsx(View, {
|
|
822
|
-
|
|
800
|
+
className: "absolute top-[4px] right-[4px] rounded-[12px] p-[2px]",
|
|
801
|
+
style: {
|
|
802
|
+
backgroundColor: 'rgba(0,0,0,0.4)'
|
|
803
|
+
},
|
|
823
804
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
824
805
|
name: selectedIds.has(photo.id) ? 'checkmark-circle' : 'ellipse-outline',
|
|
825
806
|
size: 20,
|
|
@@ -840,160 +821,6 @@ const FileManagementScreen = ({
|
|
|
840
821
|
}
|
|
841
822
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
842
823
|
}, [targetUserId]);
|
|
843
|
-
const renderFileItem = file => {
|
|
844
|
-
const isImage = file.contentType.startsWith('image/');
|
|
845
|
-
const isPDF = file.contentType.includes('pdf');
|
|
846
|
-
const isVideo = file.contentType.startsWith('video/');
|
|
847
|
-
const isAudio = file.contentType.startsWith('audio/');
|
|
848
|
-
const hasPreview = isImage || isPDF || isVideo;
|
|
849
|
-
const borderColor = colors.border;
|
|
850
|
-
return /*#__PURE__*/_jsxs(View, {
|
|
851
|
-
style: [fileManagementStyles.fileItem, {
|
|
852
|
-
backgroundColor: colors.backgroundSecondary,
|
|
853
|
-
borderColor
|
|
854
|
-
}, selectMode && selectedIds.has(file.id) && {
|
|
855
|
-
borderColor: colors.primary,
|
|
856
|
-
borderWidth: 2
|
|
857
|
-
}],
|
|
858
|
-
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
859
|
-
style: fileManagementStyles.fileContent,
|
|
860
|
-
onPress: () => handleFileOpen(file),
|
|
861
|
-
children: [/*#__PURE__*/_jsx(View, {
|
|
862
|
-
style: fileManagementStyles.filePreviewContainer,
|
|
863
|
-
children: hasPreview ? /*#__PURE__*/_jsxs(View, {
|
|
864
|
-
style: fileManagementStyles.filePreview,
|
|
865
|
-
children: [isImage && /*#__PURE__*/_jsx(ExpoImage, {
|
|
866
|
-
source: {
|
|
867
|
-
uri: thumbSourceFor(file)
|
|
868
|
-
},
|
|
869
|
-
style: fileManagementStyles.previewImage,
|
|
870
|
-
contentFit: "cover",
|
|
871
|
-
transition: 120,
|
|
872
|
-
cachePolicy: "memory-disk",
|
|
873
|
-
onError: () => {
|
|
874
|
-
// Image preview failed to load
|
|
875
|
-
},
|
|
876
|
-
accessibilityLabel: file.filename
|
|
877
|
-
}), isPDF && /*#__PURE__*/_jsxs(View, {
|
|
878
|
-
style: fileManagementStyles.pdfPreview,
|
|
879
|
-
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
880
|
-
name: "document",
|
|
881
|
-
size: 32,
|
|
882
|
-
color: colors.primary
|
|
883
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
884
|
-
style: [fileManagementStyles.pdfLabel, {
|
|
885
|
-
color: colors.primary
|
|
886
|
-
}],
|
|
887
|
-
children: "PDF"
|
|
888
|
-
})]
|
|
889
|
-
}), isVideo && /*#__PURE__*/_jsxs(View, {
|
|
890
|
-
style: fileManagementStyles.videoPreviewWrapper,
|
|
891
|
-
children: [/*#__PURE__*/_jsx(ExpoImage, {
|
|
892
|
-
source: {
|
|
893
|
-
uri: thumbSourceFor(file)
|
|
894
|
-
},
|
|
895
|
-
style: fileManagementStyles.videoPosterImage,
|
|
896
|
-
contentFit: "cover",
|
|
897
|
-
transition: 120,
|
|
898
|
-
cachePolicy: "memory-disk",
|
|
899
|
-
onError: _ => {
|
|
900
|
-
// If thumbnail not available, we still show icon overlay
|
|
901
|
-
},
|
|
902
|
-
accessibilityLabel: `${file.filename} video thumbnail`
|
|
903
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
904
|
-
style: fileManagementStyles.videoOverlay,
|
|
905
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
906
|
-
name: "play",
|
|
907
|
-
size: 24,
|
|
908
|
-
color: "#FFFFFF"
|
|
909
|
-
})
|
|
910
|
-
})]
|
|
911
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
912
|
-
style: [fileManagementStyles.fallbackIcon, {
|
|
913
|
-
display: isImage ? 'none' : 'flex'
|
|
914
|
-
}],
|
|
915
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
916
|
-
name: getFileIcon(file.contentType),
|
|
917
|
-
size: 32,
|
|
918
|
-
color: colors.primary
|
|
919
|
-
})
|
|
920
|
-
}), selectMode && /*#__PURE__*/_jsx(View, {
|
|
921
|
-
style: fileManagementStyles.selectionBadge,
|
|
922
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
923
|
-
name: selectedIds.has(file.id) ? 'checkmark-circle' : 'ellipse-outline',
|
|
924
|
-
size: 22,
|
|
925
|
-
color: selectedIds.has(file.id) ? colors.primary : colors.text
|
|
926
|
-
})
|
|
927
|
-
})]
|
|
928
|
-
}) : /*#__PURE__*/_jsx(View, {
|
|
929
|
-
style: fileManagementStyles.fileIconContainer,
|
|
930
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
931
|
-
name: getFileIcon(file.contentType),
|
|
932
|
-
size: 32,
|
|
933
|
-
color: colors.primary
|
|
934
|
-
})
|
|
935
|
-
})
|
|
936
|
-
}), /*#__PURE__*/_jsxs(View, {
|
|
937
|
-
style: fileManagementStyles.fileInfo,
|
|
938
|
-
children: [/*#__PURE__*/_jsx(Text, {
|
|
939
|
-
style: [fileManagementStyles.fileName, {
|
|
940
|
-
color: colors.text
|
|
941
|
-
}],
|
|
942
|
-
numberOfLines: 1,
|
|
943
|
-
children: file.filename
|
|
944
|
-
}), /*#__PURE__*/_jsxs(Text, {
|
|
945
|
-
style: [fileManagementStyles.fileDetails, {
|
|
946
|
-
color: colors.textSecondary
|
|
947
|
-
}],
|
|
948
|
-
children: [formatFileSize(file.length), " \u2022 ", new Date(file.uploadDate).toLocaleDateString()]
|
|
949
|
-
}), file.metadata?.description && /*#__PURE__*/_jsx(Text, {
|
|
950
|
-
style: [fileManagementStyles.fileDescription, {
|
|
951
|
-
color: colors.textTertiary
|
|
952
|
-
}],
|
|
953
|
-
numberOfLines: 2,
|
|
954
|
-
children: file.metadata.description
|
|
955
|
-
})]
|
|
956
|
-
})]
|
|
957
|
-
}), !selectMode && /*#__PURE__*/_jsxs(View, {
|
|
958
|
-
style: fileManagementStyles.fileActions,
|
|
959
|
-
children: [hasPreview && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
960
|
-
style: [fileManagementStyles.actionButton, {
|
|
961
|
-
backgroundColor: colors.backgroundSecondary
|
|
962
|
-
}],
|
|
963
|
-
onPress: () => handleFileOpen(file),
|
|
964
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
965
|
-
name: "eye",
|
|
966
|
-
size: 20,
|
|
967
|
-
color: colors.primary
|
|
968
|
-
})
|
|
969
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
970
|
-
style: [fileManagementStyles.actionButton, {
|
|
971
|
-
backgroundColor: colors.backgroundSecondary
|
|
972
|
-
}],
|
|
973
|
-
onPress: () => handleFileDownload(file.id, file.filename),
|
|
974
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
975
|
-
name: "download",
|
|
976
|
-
size: 20,
|
|
977
|
-
color: colors.primary
|
|
978
|
-
})
|
|
979
|
-
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
980
|
-
style: [fileManagementStyles.actionButton, {
|
|
981
|
-
backgroundColor: colors.negativeSubtle
|
|
982
|
-
}],
|
|
983
|
-
onPress: () => confirmFileDelete(file.id, file.filename),
|
|
984
|
-
disabled: deleting === file.id,
|
|
985
|
-
children: deleting === file.id ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
986
|
-
size: "small",
|
|
987
|
-
color: colors.error
|
|
988
|
-
}) : /*#__PURE__*/_jsx(Ionicons, {
|
|
989
|
-
name: "trash",
|
|
990
|
-
size: 20,
|
|
991
|
-
color: colors.error
|
|
992
|
-
})
|
|
993
|
-
})]
|
|
994
|
-
})]
|
|
995
|
-
}, file.id);
|
|
996
|
-
};
|
|
997
824
|
|
|
998
825
|
// SettingsListItem-based file items (for 'all' view)
|
|
999
826
|
const groupedFileItems = useMemo(() => {
|
|
@@ -1115,11 +942,12 @@ const FileManagementScreen = ({
|
|
|
1115
942
|
},
|
|
1116
943
|
// Hide action buttons when selecting (in selectMode or bulk operations mode)
|
|
1117
944
|
rightElement: !selectMode && selectedIds.size === 0 ? /*#__PURE__*/_jsxs(View, {
|
|
1118
|
-
|
|
945
|
+
className: "flex-row items-center gap-[6px] ml-[12px]",
|
|
1119
946
|
children: [(isImage || isVideo || file.contentType.includes('pdf')) && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1120
|
-
|
|
947
|
+
className: "w-[34px] h-[34px] rounded-[8px] items-center justify-center",
|
|
948
|
+
style: {
|
|
1121
949
|
backgroundColor: colors.backgroundSecondary
|
|
1122
|
-
}
|
|
950
|
+
},
|
|
1123
951
|
onPress: () => handleFileOpen(file),
|
|
1124
952
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1125
953
|
name: "eye",
|
|
@@ -1127,9 +955,10 @@ const FileManagementScreen = ({
|
|
|
1127
955
|
color: colors.primary
|
|
1128
956
|
})
|
|
1129
957
|
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1130
|
-
|
|
958
|
+
className: "w-[34px] h-[34px] rounded-[8px] items-center justify-center",
|
|
959
|
+
style: {
|
|
1131
960
|
backgroundColor: colors.backgroundSecondary
|
|
1132
|
-
}
|
|
961
|
+
},
|
|
1133
962
|
onPress: () => handleFileDownload(file.id, file.filename),
|
|
1134
963
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1135
964
|
name: "download",
|
|
@@ -1137,9 +966,10 @@ const FileManagementScreen = ({
|
|
|
1137
966
|
color: colors.primary
|
|
1138
967
|
})
|
|
1139
968
|
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1140
|
-
|
|
969
|
+
className: "w-[34px] h-[34px] rounded-[8px] items-center justify-center",
|
|
970
|
+
style: {
|
|
1141
971
|
backgroundColor: colors.negativeSubtle
|
|
1142
|
-
}
|
|
972
|
+
},
|
|
1143
973
|
onPress: () => confirmFileDelete(file.id, file.filename),
|
|
1144
974
|
disabled: deleting === file.id,
|
|
1145
975
|
children: deleting === file.id ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
@@ -1199,19 +1029,12 @@ const FileManagementScreen = ({
|
|
|
1199
1029
|
const photos = filteredFiles.filter(file => file.contentType.startsWith('image/'));
|
|
1200
1030
|
const photoIndex = photos.findIndex(p => p.id === lastSelectedFileId);
|
|
1201
1031
|
if (photoIndex >= 0) {
|
|
1202
|
-
//
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
const scrollContainerPadding = 32;
|
|
1207
|
-
const gaps = (itemsPerRow - 1) * 4;
|
|
1208
|
-
const availableWidth = safeContainerWidth - scrollContainerPadding;
|
|
1209
|
-
const itemWidth = (availableWidth - gaps) / itemsPerRow;
|
|
1210
|
-
|
|
1211
|
-
// Calculate row and approximate scroll position
|
|
1032
|
+
// Rough scroll estimate for the justified grid (3 photos/row; variable row heights).
|
|
1033
|
+
const itemsPerRow = 3;
|
|
1034
|
+
const estimatedRowHeight = 150;
|
|
1035
|
+
const rowGap = 4;
|
|
1212
1036
|
const row = Math.floor(photoIndex / itemsPerRow);
|
|
1213
|
-
const
|
|
1214
|
-
const finalScrollPosition = headerHeight + row * (itemWidth + 4) - 150;
|
|
1037
|
+
const finalScrollPosition = row * (estimatedRowHeight + rowGap) - 100;
|
|
1215
1038
|
|
|
1216
1039
|
// Use requestAnimationFrame to ensure DOM is updated before scrolling
|
|
1217
1040
|
requestAnimationFrame(() => {
|
|
@@ -1237,67 +1060,32 @@ const FileManagementScreen = ({
|
|
|
1237
1060
|
return () => clearTimeout(timeoutId);
|
|
1238
1061
|
}
|
|
1239
1062
|
}, [lastSelectedFileId]);
|
|
1240
|
-
const renderPhotoItem = (photo, index) => {
|
|
1241
|
-
const downloadUrl = thumbSourceFor(photo);
|
|
1242
|
-
|
|
1243
|
-
// Calculate photo item width based on actual container size from bottom sheet
|
|
1244
|
-
let itemsPerRow = 3; // Default for mobile
|
|
1245
|
-
if (safeContainerWidth > 768) itemsPerRow = 6; // Tablet/Desktop
|
|
1246
|
-
else if (safeContainerWidth > 480) itemsPerRow = 4; // Large mobile
|
|
1247
|
-
|
|
1248
|
-
// Account for the photoScrollContainer padding (16px on each side = 32px total)
|
|
1249
|
-
const scrollContainerPadding = 32; // Total horizontal padding from photoScrollContainer
|
|
1250
|
-
const gaps = (itemsPerRow - 1) * 4; // Gap between items
|
|
1251
|
-
const availableWidth = safeContainerWidth - scrollContainerPadding;
|
|
1252
|
-
const itemWidth = (availableWidth - gaps) / itemsPerRow;
|
|
1253
|
-
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1254
|
-
style: [fileManagementStyles.photoItem, {
|
|
1255
|
-
width: itemWidth,
|
|
1256
|
-
height: itemWidth
|
|
1257
|
-
}],
|
|
1258
|
-
onPress: () => handleFileOpen(photo),
|
|
1259
|
-
activeOpacity: 0.8,
|
|
1260
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
1261
|
-
style: fileManagementStyles.photoContainer,
|
|
1262
|
-
children: /*#__PURE__*/_jsx(ExpoImage, {
|
|
1263
|
-
source: {
|
|
1264
|
-
uri: downloadUrl
|
|
1265
|
-
},
|
|
1266
|
-
style: fileManagementStyles.photoImage,
|
|
1267
|
-
contentFit: "cover",
|
|
1268
|
-
transition: 120,
|
|
1269
|
-
cachePolicy: "memory-disk",
|
|
1270
|
-
onError: () => {
|
|
1271
|
-
// Image preview failed to load
|
|
1272
|
-
},
|
|
1273
|
-
accessibilityLabel: photo.filename
|
|
1274
|
-
})
|
|
1275
|
-
})
|
|
1276
|
-
}, photo.id);
|
|
1277
|
-
};
|
|
1278
1063
|
const renderPhotoGrid = useCallback(() => {
|
|
1279
1064
|
const photos = filteredFiles.filter(file => file.contentType.startsWith('image/'));
|
|
1280
1065
|
if (photos.length === 0) {
|
|
1281
1066
|
return /*#__PURE__*/_jsxs(View, {
|
|
1282
|
-
|
|
1067
|
+
className: "items-center py-[40px] px-[24px]",
|
|
1283
1068
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1284
1069
|
name: "images-outline",
|
|
1285
1070
|
size: 64,
|
|
1286
1071
|
color: colors.textTertiary
|
|
1287
1072
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1288
|
-
|
|
1073
|
+
className: "text-[24px] font-bold mt-[16px] mb-[8px]",
|
|
1074
|
+
style: {
|
|
1289
1075
|
color: colors.text
|
|
1290
|
-
}
|
|
1076
|
+
},
|
|
1291
1077
|
children: t('fileManagement.emptyPhotos.title')
|
|
1292
1078
|
}), /*#__PURE__*/_jsxs(Text, {
|
|
1293
|
-
|
|
1079
|
+
className: "text-[16px] text-center leading-[24px] mb-[32px]",
|
|
1080
|
+
style: {
|
|
1294
1081
|
color: colors.textSecondary
|
|
1295
|
-
}
|
|
1082
|
+
},
|
|
1296
1083
|
children: [" ", user?.id === targetUserId ? t('fileManagement.emptyPhotos.ownDescription') : t('fileManagement.emptyPhotos.otherDescription'), " "]
|
|
1297
1084
|
}), user?.id === targetUserId && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1298
|
-
|
|
1085
|
+
className: "flex-row items-center px-[24px] py-[12px] rounded-[24px] gap-[8px]",
|
|
1086
|
+
style: {
|
|
1299
1087
|
backgroundColor: colors.primary
|
|
1300
|
-
}
|
|
1088
|
+
},
|
|
1301
1089
|
onPress: handleFileUpload,
|
|
1302
1090
|
disabled: uploading || isPickingDocument,
|
|
1303
1091
|
children: uploading ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
@@ -1312,7 +1100,7 @@ const FileManagementScreen = ({
|
|
|
1312
1100
|
size: 20,
|
|
1313
1101
|
color: "#FFFFFF"
|
|
1314
1102
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1315
|
-
|
|
1103
|
+
className: "text-white text-[16px] font-semibold",
|
|
1316
1104
|
children: t('fileManagement.uploadPhotos')
|
|
1317
1105
|
})]
|
|
1318
1106
|
})
|
|
@@ -1321,8 +1109,8 @@ const FileManagementScreen = ({
|
|
|
1321
1109
|
}
|
|
1322
1110
|
return /*#__PURE__*/_jsxs(ScrollView, {
|
|
1323
1111
|
ref: photoScrollViewRef,
|
|
1324
|
-
|
|
1325
|
-
|
|
1112
|
+
className: "flex-1",
|
|
1113
|
+
contentContainerClassName: "p-[10px]",
|
|
1326
1114
|
refreshControl: /*#__PURE__*/_jsx(RefreshControl, {
|
|
1327
1115
|
refreshing: refreshing,
|
|
1328
1116
|
onRefresh: () => loadFiles('refresh'),
|
|
@@ -1344,14 +1132,15 @@ const FileManagementScreen = ({
|
|
|
1344
1132
|
},
|
|
1345
1133
|
scrollEventThrottle: 250,
|
|
1346
1134
|
children: [loadingDimensions && /*#__PURE__*/_jsxs(View, {
|
|
1347
|
-
|
|
1135
|
+
className: "flex-row items-center justify-center py-[16px] gap-[8px]",
|
|
1348
1136
|
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
1349
1137
|
size: "small",
|
|
1350
1138
|
color: colors.primary
|
|
1351
1139
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1352
|
-
|
|
1140
|
+
className: "text-[14px] italic",
|
|
1141
|
+
style: {
|
|
1353
1142
|
color: colors.textSecondary
|
|
1354
|
-
}
|
|
1143
|
+
},
|
|
1355
1144
|
children: t('fileManagement.loadingPhotoLayout')
|
|
1356
1145
|
})]
|
|
1357
1146
|
}), /*#__PURE__*/_jsx(JustifiedPhotoGrid, {
|
|
@@ -1360,35 +1149,37 @@ const FileManagementScreen = ({
|
|
|
1360
1149
|
loadPhotoDimensions: loadPhotoDimensions,
|
|
1361
1150
|
createJustifiedRows: createJustifiedRows,
|
|
1362
1151
|
renderJustifiedPhotoItem: renderJustifiedPhotoItem,
|
|
1363
|
-
renderSimplePhotoItem: renderPhotoItem,
|
|
1364
1152
|
textColor: colors.text,
|
|
1365
|
-
containerWidth:
|
|
1153
|
+
containerWidth: typeof containerWidth === 'number' && containerWidth > 0 ? containerWidth : undefined
|
|
1366
1154
|
})]
|
|
1367
1155
|
});
|
|
1368
|
-
}, [filteredFiles, colors, user?.id, targetUserId, uploading, handleFileUpload, refreshing, loadFiles, loadingDimensions, photoDimensions, loadPhotoDimensions, createJustifiedRows, renderJustifiedPhotoItem,
|
|
1156
|
+
}, [filteredFiles, colors, user?.id, targetUserId, uploading, handleFileUpload, refreshing, loadFiles, loadingDimensions, photoDimensions, loadPhotoDimensions, createJustifiedRows, renderJustifiedPhotoItem, containerWidth]);
|
|
1369
1157
|
|
|
1370
1158
|
// Inline justified grid removed (moved to components/photogrid/JustifiedPhotoGrid.tsx)
|
|
1371
1159
|
|
|
1372
1160
|
const renderEmptyState = () => /*#__PURE__*/_jsxs(View, {
|
|
1373
|
-
|
|
1161
|
+
className: "items-center py-[40px] px-[24px]",
|
|
1374
1162
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1375
1163
|
name: "folder-open-outline",
|
|
1376
1164
|
size: 64,
|
|
1377
1165
|
color: colors.textTertiary
|
|
1378
1166
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1379
|
-
|
|
1167
|
+
className: "text-[24px] font-bold mt-[16px] mb-[8px]",
|
|
1168
|
+
style: {
|
|
1380
1169
|
color: colors.text
|
|
1381
|
-
}
|
|
1170
|
+
},
|
|
1382
1171
|
children: t('fileManagement.emptyFiles.title')
|
|
1383
1172
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1384
|
-
|
|
1173
|
+
className: "text-[16px] text-center leading-[24px] mb-[32px]",
|
|
1174
|
+
style: {
|
|
1385
1175
|
color: colors.textSecondary
|
|
1386
|
-
}
|
|
1176
|
+
},
|
|
1387
1177
|
children: user?.id === targetUserId ? t('fileManagement.emptyFiles.ownDescription') : t('fileManagement.emptyFiles.otherDescription')
|
|
1388
1178
|
}), user?.id === targetUserId && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1389
|
-
|
|
1179
|
+
className: "flex-row items-center px-[24px] py-[12px] rounded-[24px] gap-[8px]",
|
|
1180
|
+
style: {
|
|
1390
1181
|
backgroundColor: colors.primary
|
|
1391
|
-
}
|
|
1182
|
+
},
|
|
1392
1183
|
onPress: handleFileUpload,
|
|
1393
1184
|
disabled: uploading || isPickingDocument,
|
|
1394
1185
|
children: uploading ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
@@ -1403,7 +1194,7 @@ const FileManagementScreen = ({
|
|
|
1403
1194
|
size: 20,
|
|
1404
1195
|
color: "#FFFFFF"
|
|
1405
1196
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1406
|
-
|
|
1197
|
+
className: "text-white text-[16px] font-semibold",
|
|
1407
1198
|
children: t('fileManagement.uploadFiles')
|
|
1408
1199
|
})]
|
|
1409
1200
|
})
|
|
@@ -1419,7 +1210,10 @@ const FileManagementScreen = ({
|
|
|
1419
1210
|
toValue: 1,
|
|
1420
1211
|
duration: 2000,
|
|
1421
1212
|
easing: Easing.linear,
|
|
1422
|
-
|
|
1213
|
+
// Web has no native animated module; forcing the native
|
|
1214
|
+
// driver there warns and falls back to JS. The shimmer only
|
|
1215
|
+
// drives a transform, so JS-driving it on web is fine.
|
|
1216
|
+
useNativeDriver: Platform.OS !== 'web'
|
|
1423
1217
|
}));
|
|
1424
1218
|
shimmer.start();
|
|
1425
1219
|
return () => shimmer.stop();
|
|
@@ -1527,22 +1321,22 @@ const FileManagementScreen = ({
|
|
|
1527
1321
|
})]
|
|
1528
1322
|
});
|
|
1529
1323
|
return /*#__PURE__*/_jsxs(View, {
|
|
1530
|
-
|
|
1324
|
+
className: "flex-1",
|
|
1325
|
+
style: {
|
|
1531
1326
|
backgroundColor
|
|
1532
|
-
}
|
|
1327
|
+
},
|
|
1533
1328
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
1534
|
-
|
|
1329
|
+
className: "flex-row items-center justify-between px-[16px] py-[12px] relative",
|
|
1330
|
+
style: {
|
|
1535
1331
|
borderBottomColor: colors.border,
|
|
1536
1332
|
borderBottomWidth: StyleSheet.hairlineWidth
|
|
1537
|
-
}
|
|
1333
|
+
},
|
|
1538
1334
|
children: [/*#__PURE__*/_jsx(SkeletonBox, {
|
|
1539
1335
|
width: 44,
|
|
1540
1336
|
height: 44,
|
|
1541
1337
|
borderRadius: 12
|
|
1542
1338
|
}), /*#__PURE__*/_jsxs(View, {
|
|
1543
|
-
|
|
1544
|
-
flex: 1
|
|
1545
|
-
}],
|
|
1339
|
+
className: "flex-1 items-center justify-center mx-[16px]",
|
|
1546
1340
|
children: [/*#__PURE__*/_jsx(SkeletonBox, {
|
|
1547
1341
|
width: 140,
|
|
1548
1342
|
height: 20,
|
|
@@ -1559,7 +1353,7 @@ const FileManagementScreen = ({
|
|
|
1559
1353
|
borderRadius: 12
|
|
1560
1354
|
})]
|
|
1561
1355
|
}), /*#__PURE__*/_jsxs(View, {
|
|
1562
|
-
|
|
1356
|
+
className: "flex-row items-center justify-between px-[12px] py-[12px] gap-[12px]",
|
|
1563
1357
|
children: [/*#__PURE__*/_jsx(SkeletonBox, {
|
|
1564
1358
|
width: 100,
|
|
1565
1359
|
height: 36,
|
|
@@ -1570,20 +1364,22 @@ const FileManagementScreen = ({
|
|
|
1570
1364
|
borderRadius: 22
|
|
1571
1365
|
})]
|
|
1572
1366
|
}), /*#__PURE__*/_jsx(View, {
|
|
1573
|
-
|
|
1367
|
+
className: "flex-row items-center px-[14px] py-[10px] mx-[12px] mb-[12px] rounded-full gap-[10px]",
|
|
1368
|
+
style: {
|
|
1574
1369
|
backgroundColor: colors.card
|
|
1575
|
-
}
|
|
1370
|
+
},
|
|
1576
1371
|
children: /*#__PURE__*/_jsx(SkeletonBox, {
|
|
1577
1372
|
width: "100%",
|
|
1578
1373
|
height: 44,
|
|
1579
1374
|
borderRadius: 12
|
|
1580
1375
|
})
|
|
1581
1376
|
}), /*#__PURE__*/_jsx(View, {
|
|
1582
|
-
|
|
1377
|
+
className: "flex-row px-[14px] py-[10px] mx-[12px] mb-[12px] rounded-[18px]",
|
|
1378
|
+
style: {
|
|
1583
1379
|
backgroundColor: colors.card
|
|
1584
|
-
}
|
|
1380
|
+
},
|
|
1585
1381
|
children: [1, 2, 3].map(i => /*#__PURE__*/_jsxs(View, {
|
|
1586
|
-
|
|
1382
|
+
className: "flex-1 items-center py-[4px]",
|
|
1587
1383
|
children: [/*#__PURE__*/_jsx(SkeletonBox, {
|
|
1588
1384
|
width: 50,
|
|
1589
1385
|
height: 20,
|
|
@@ -1598,8 +1394,8 @@ const FileManagementScreen = ({
|
|
|
1598
1394
|
})]
|
|
1599
1395
|
}, i))
|
|
1600
1396
|
}), /*#__PURE__*/_jsx(ScrollView, {
|
|
1601
|
-
|
|
1602
|
-
|
|
1397
|
+
className: "flex-1",
|
|
1398
|
+
contentContainerClassName: "px-[12px] pt-0 pb-[12px]",
|
|
1603
1399
|
showsVerticalScrollIndicator: false,
|
|
1604
1400
|
children: /*#__PURE__*/_jsx(View, {
|
|
1605
1401
|
style: {
|
|
@@ -1690,7 +1486,7 @@ const FileManagementScreen = ({
|
|
|
1690
1486
|
// If upload preview is showing, render it inline instead of the file list
|
|
1691
1487
|
if (showUploadPreview) {
|
|
1692
1488
|
return /*#__PURE__*/_jsxs(View, {
|
|
1693
|
-
|
|
1489
|
+
className: "flex-1",
|
|
1694
1490
|
children: [/*#__PURE__*/_jsx(Header, {
|
|
1695
1491
|
title: t('fileManagement.reviewFiles'),
|
|
1696
1492
|
subtitle: t('fileManagement.readyToUpload', {
|
|
@@ -1711,7 +1507,7 @@ const FileManagementScreen = ({
|
|
|
1711
1507
|
});
|
|
1712
1508
|
}
|
|
1713
1509
|
return /*#__PURE__*/_jsxs(View, {
|
|
1714
|
-
|
|
1510
|
+
className: "flex-1",
|
|
1715
1511
|
children: [/*#__PURE__*/_jsx(Header, {
|
|
1716
1512
|
title: selectMode ? multiSelect ? maxSelection ? t('fileManagement.selectedWithMax', {
|
|
1717
1513
|
count: selectedIds.size,
|
|
@@ -1761,22 +1557,26 @@ const FileManagementScreen = ({
|
|
|
1761
1557
|
elevation: "none",
|
|
1762
1558
|
titleAlignment: "left"
|
|
1763
1559
|
}), /*#__PURE__*/_jsxs(View, {
|
|
1764
|
-
|
|
1560
|
+
className: "flex-row items-center justify-between px-[12px] py-[12px] gap-[12px]",
|
|
1765
1561
|
children: [/*#__PURE__*/_jsx(ScrollView, {
|
|
1766
1562
|
horizontal: true,
|
|
1767
1563
|
showsHorizontalScrollIndicator: false,
|
|
1768
|
-
|
|
1564
|
+
className: "flex-1",
|
|
1565
|
+
style: {
|
|
1566
|
+
maxWidth: '80%'
|
|
1567
|
+
},
|
|
1769
1568
|
children: /*#__PURE__*/_jsxs(View, {
|
|
1770
|
-
|
|
1569
|
+
className: "flex-row rounded-full p-[2px] overflow-hidden",
|
|
1570
|
+
style: {
|
|
1771
1571
|
backgroundColor: colors.card
|
|
1772
|
-
}
|
|
1572
|
+
},
|
|
1773
1573
|
children: [/*#__PURE__*/_jsx(AnimatedButton, {
|
|
1774
1574
|
isSelected: viewMode === 'all',
|
|
1775
1575
|
onPress: () => setViewMode('all'),
|
|
1776
1576
|
icon: viewMode === 'all' ? 'folder' : 'folder-outline',
|
|
1777
1577
|
primaryColor: colors.primary,
|
|
1778
1578
|
textColor: colors.text,
|
|
1779
|
-
style:
|
|
1579
|
+
style: screenStyles.viewModeButton,
|
|
1780
1580
|
accessibilityLabel: t('fileManagement.a11y.viewAll') || 'Show all files'
|
|
1781
1581
|
}), /*#__PURE__*/_jsx(AnimatedButton, {
|
|
1782
1582
|
isSelected: viewMode === 'photos',
|
|
@@ -1784,7 +1584,7 @@ const FileManagementScreen = ({
|
|
|
1784
1584
|
icon: viewMode === 'photos' ? 'image-multiple' : 'image-multiple-outline',
|
|
1785
1585
|
primaryColor: colors.primary,
|
|
1786
1586
|
textColor: colors.text,
|
|
1787
|
-
style:
|
|
1587
|
+
style: screenStyles.viewModeButton,
|
|
1788
1588
|
accessibilityLabel: t('fileManagement.a11y.viewPhotos') || 'Show photos only'
|
|
1789
1589
|
}), !isImageOnlyPicker && /*#__PURE__*/_jsxs(_Fragment, {
|
|
1790
1590
|
children: [/*#__PURE__*/_jsx(AnimatedButton, {
|
|
@@ -1793,7 +1593,7 @@ const FileManagementScreen = ({
|
|
|
1793
1593
|
icon: viewMode === 'videos' ? 'video' : 'video-outline',
|
|
1794
1594
|
primaryColor: colors.primary,
|
|
1795
1595
|
textColor: colors.text,
|
|
1796
|
-
style:
|
|
1596
|
+
style: screenStyles.viewModeButton,
|
|
1797
1597
|
accessibilityLabel: t('fileManagement.a11y.viewVideos') || 'Show videos only'
|
|
1798
1598
|
}), /*#__PURE__*/_jsx(AnimatedButton, {
|
|
1799
1599
|
isSelected: viewMode === 'documents',
|
|
@@ -1801,7 +1601,7 @@ const FileManagementScreen = ({
|
|
|
1801
1601
|
icon: viewMode === 'documents' ? 'file-document' : 'file-document-outline',
|
|
1802
1602
|
primaryColor: colors.primary,
|
|
1803
1603
|
textColor: colors.text,
|
|
1804
|
-
style:
|
|
1604
|
+
style: screenStyles.viewModeButton,
|
|
1805
1605
|
accessibilityLabel: t('fileManagement.a11y.viewDocuments') || 'Show documents only'
|
|
1806
1606
|
}), /*#__PURE__*/_jsx(AnimatedButton, {
|
|
1807
1607
|
isSelected: viewMode === 'audio',
|
|
@@ -1809,15 +1609,16 @@ const FileManagementScreen = ({
|
|
|
1809
1609
|
icon: viewMode === 'audio' ? 'music-note' : 'music-note-outline',
|
|
1810
1610
|
primaryColor: colors.primary,
|
|
1811
1611
|
textColor: colors.text,
|
|
1812
|
-
style:
|
|
1612
|
+
style: screenStyles.viewModeButton,
|
|
1813
1613
|
accessibilityLabel: t('fileManagement.a11y.viewAudio') || 'Show audio only'
|
|
1814
1614
|
})]
|
|
1815
1615
|
})]
|
|
1816
1616
|
})
|
|
1817
1617
|
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
1818
|
-
|
|
1618
|
+
className: "flex-row items-center justify-center px-[10px] py-[6px] rounded-full min-w-[36px] gap-[4px]",
|
|
1619
|
+
style: {
|
|
1819
1620
|
backgroundColor: colors.card
|
|
1820
|
-
}
|
|
1621
|
+
},
|
|
1821
1622
|
accessibilityRole: "button",
|
|
1822
1623
|
accessibilityLabel: t('fileManagement.a11y.sortBy', {
|
|
1823
1624
|
field: sortBy,
|
|
@@ -1844,9 +1645,10 @@ const FileManagementScreen = ({
|
|
|
1844
1645
|
color: colors.textSecondary
|
|
1845
1646
|
})]
|
|
1846
1647
|
}), user?.id === targetUserId && (!selectMode || selectMode && allowUploadInSelectMode) && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1847
|
-
|
|
1648
|
+
className: `h-[44px] rounded-[22px] items-center justify-center ${isImageOnlyPicker ? 'w-auto min-w-[44px] px-[14px]' : 'w-[44px]'}`,
|
|
1649
|
+
style: {
|
|
1848
1650
|
backgroundColor: colors.primary
|
|
1849
|
-
}
|
|
1651
|
+
},
|
|
1850
1652
|
onPress: handleFileUpload,
|
|
1851
1653
|
disabled: uploading || isPickingDocument,
|
|
1852
1654
|
accessibilityRole: "button",
|
|
@@ -1855,25 +1657,25 @@ const FileManagementScreen = ({
|
|
|
1855
1657
|
busy: uploading || isPickingDocument
|
|
1856
1658
|
},
|
|
1857
1659
|
children: uploading ? /*#__PURE__*/_jsxs(View, {
|
|
1858
|
-
|
|
1660
|
+
className: "items-center justify-center",
|
|
1859
1661
|
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
1860
1662
|
size: "small",
|
|
1861
1663
|
color: "#FFFFFF"
|
|
1862
1664
|
}), uploadProgress && /*#__PURE__*/_jsxs(Text, {
|
|
1863
|
-
|
|
1665
|
+
className: "text-white text-[10px] font-semibold mt-[2px]",
|
|
1864
1666
|
children: [uploadProgress.current, "/", uploadProgress.total]
|
|
1865
1667
|
})]
|
|
1866
1668
|
}) : isPickingDocument ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
1867
1669
|
size: "small",
|
|
1868
1670
|
color: "#FFFFFF"
|
|
1869
1671
|
}) : isImageOnlyPicker ? /*#__PURE__*/_jsxs(View, {
|
|
1870
|
-
|
|
1672
|
+
className: "flex-row items-center gap-[6px]",
|
|
1871
1673
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1872
1674
|
name: "cloud-upload",
|
|
1873
1675
|
size: 18,
|
|
1874
1676
|
color: "#FFFFFF"
|
|
1875
1677
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1876
|
-
|
|
1678
|
+
className: "text-white text-[14px] font-semibold",
|
|
1877
1679
|
numberOfLines: 1,
|
|
1878
1680
|
children: t('fileManagement.upload') || 'Upload'
|
|
1879
1681
|
})]
|
|
@@ -1884,24 +1686,26 @@ const FileManagementScreen = ({
|
|
|
1884
1686
|
})
|
|
1885
1687
|
})]
|
|
1886
1688
|
}), files.length > 0 && (viewMode === 'all' || files.some(f => f.contentType.startsWith('image/'))) && /*#__PURE__*/_jsxs(View, {
|
|
1887
|
-
|
|
1689
|
+
className: "flex-row items-center px-[14px] py-[10px] mx-[12px] mb-[12px] rounded-full gap-[10px]",
|
|
1690
|
+
style: {
|
|
1888
1691
|
backgroundColor: colors.card
|
|
1889
|
-
}
|
|
1692
|
+
},
|
|
1890
1693
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1891
1694
|
name: "search",
|
|
1892
1695
|
size: 22,
|
|
1893
1696
|
color: colors.icon
|
|
1894
1697
|
}), /*#__PURE__*/_jsx(TextInput, {
|
|
1895
|
-
|
|
1698
|
+
className: "flex-1 text-[16px] leading-[20px]",
|
|
1699
|
+
style: {
|
|
1896
1700
|
color: colors.text
|
|
1897
|
-
}
|
|
1701
|
+
},
|
|
1898
1702
|
placeholder: viewMode === 'photos' ? t('fileManagement.searchPhotos') : t('fileManagement.searchFiles'),
|
|
1899
1703
|
placeholderTextColor: colors.textSecondary,
|
|
1900
1704
|
value: searchQuery,
|
|
1901
1705
|
onChangeText: setSearchQuery
|
|
1902
1706
|
}), searchQuery.length > 0 && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1903
1707
|
onPress: () => setSearchQuery(''),
|
|
1904
|
-
|
|
1708
|
+
className: "p-[4px] rounded-[12px] items-center justify-center",
|
|
1905
1709
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1906
1710
|
name: "close-circle",
|
|
1907
1711
|
size: 22,
|
|
@@ -1909,46 +1713,59 @@ const FileManagementScreen = ({
|
|
|
1909
1713
|
})
|
|
1910
1714
|
})]
|
|
1911
1715
|
}), files.length > 0 && /*#__PURE__*/_jsxs(View, {
|
|
1912
|
-
|
|
1716
|
+
className: "flex-row px-[14px] py-[10px] mx-[12px] mb-[12px] rounded-[18px]",
|
|
1717
|
+
style: {
|
|
1913
1718
|
backgroundColor: colors.card
|
|
1914
|
-
}
|
|
1719
|
+
},
|
|
1915
1720
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
1916
|
-
|
|
1721
|
+
className: "flex-1 items-center py-[4px]",
|
|
1917
1722
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
1723
|
+
className: "text-[20px] font-extrabold leading-[24px]",
|
|
1724
|
+
style: {
|
|
1725
|
+
color: colors.text,
|
|
1726
|
+
letterSpacing: -0.5
|
|
1727
|
+
},
|
|
1921
1728
|
children: filteredFiles.length
|
|
1922
1729
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1923
|
-
|
|
1924
|
-
|
|
1925
|
-
|
|
1730
|
+
className: "text-[12px] font-medium mt-[2px]",
|
|
1731
|
+
style: {
|
|
1732
|
+
color: colors.textSecondary,
|
|
1733
|
+
letterSpacing: 0.2
|
|
1734
|
+
},
|
|
1926
1735
|
children: searchQuery.length > 0 ? t('fileManagement.found') : filteredFiles.length === 1 ? viewMode === 'photos' ? t('fileManagement.photo') : t('fileManagement.file') : viewMode === 'photos' ? t('fileManagement.photos_stat') : t('fileManagement.files')
|
|
1927
1736
|
})]
|
|
1928
1737
|
}), /*#__PURE__*/_jsxs(View, {
|
|
1929
|
-
|
|
1738
|
+
className: "flex-1 items-center py-[4px]",
|
|
1930
1739
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
|
|
1740
|
+
className: "text-[20px] font-extrabold leading-[24px]",
|
|
1741
|
+
style: {
|
|
1742
|
+
color: colors.text,
|
|
1743
|
+
letterSpacing: -0.5
|
|
1744
|
+
},
|
|
1934
1745
|
children: formatFileSize(filteredFiles.reduce((total, file) => total + file.length, 0))
|
|
1935
1746
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1936
|
-
|
|
1937
|
-
|
|
1938
|
-
|
|
1747
|
+
className: "text-[12px] font-medium mt-[2px]",
|
|
1748
|
+
style: {
|
|
1749
|
+
color: colors.textSecondary,
|
|
1750
|
+
letterSpacing: 0.2
|
|
1751
|
+
},
|
|
1939
1752
|
children: searchQuery.length > 0 ? t('fileManagement.size') : t('fileManagement.totalSize')
|
|
1940
1753
|
})]
|
|
1941
1754
|
}), searchQuery.length > 0 && /*#__PURE__*/_jsxs(View, {
|
|
1942
|
-
|
|
1755
|
+
className: "flex-1 items-center py-[4px]",
|
|
1943
1756
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1944
|
-
|
|
1945
|
-
|
|
1946
|
-
|
|
1757
|
+
className: "text-[20px] font-extrabold leading-[24px]",
|
|
1758
|
+
style: {
|
|
1759
|
+
color: colors.text,
|
|
1760
|
+
letterSpacing: -0.5
|
|
1761
|
+
},
|
|
1947
1762
|
children: files.length
|
|
1948
1763
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1949
|
-
|
|
1950
|
-
|
|
1951
|
-
|
|
1764
|
+
className: "text-[12px] font-medium mt-[2px]",
|
|
1765
|
+
style: {
|
|
1766
|
+
color: colors.textSecondary,
|
|
1767
|
+
letterSpacing: 0.2
|
|
1768
|
+
},
|
|
1952
1769
|
children: t('fileManagement.total')
|
|
1953
1770
|
})]
|
|
1954
1771
|
})]
|
|
@@ -2026,8 +1843,5 @@ const FileManagementScreen = ({
|
|
|
2026
1843
|
})]
|
|
2027
1844
|
});
|
|
2028
1845
|
};
|
|
2029
|
-
|
|
2030
|
-
// Styles have been moved to components/fileManagement/styles.ts
|
|
2031
|
-
|
|
2032
1846
|
export default FileManagementScreen;
|
|
2033
1847
|
//# sourceMappingURL=FileManagementScreen.js.map
|