@oxyhq/services 6.9.44 → 6.9.45
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/OxyPayButton.js +4 -2
- package/lib/commonjs/ui/components/OxyPayButton.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +83 -82
- package/lib/commonjs/ui/components/OxySignInButton.js.map +1 -1
- package/lib/commonjs/ui/components/SettingRow.js +11 -5
- package/lib/commonjs/ui/components/SettingRow.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js +76 -121
- package/lib/commonjs/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js +32 -18
- package/lib/commonjs/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/commonjs/ui/components/icon/OxyIcon.js +5 -4
- package/lib/commonjs/ui/components/icon/OxyIcon.js.map +1 -1
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js +11 -9
- package/lib/commonjs/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/commonjs/ui/components/internal/PinInput.js +3 -2
- package/lib/commonjs/ui/components/internal/PinInput.js.map +1 -1
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js +83 -219
- package/lib/commonjs/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/commonjs/ui/constants/theme.js +2 -2
- package/lib/commonjs/ui/constants/theme.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +12 -10
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +70 -79
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +22 -10
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +141 -81
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js +21 -9
- package/lib/commonjs/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/FileManagementScreen.js +83 -50
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/HistoryViewScreen.js +80 -101
- package/lib/commonjs/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +66 -93
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +101 -66
- package/lib/commonjs/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/utils/fileManagement.js +0 -21
- package/lib/commonjs/ui/utils/fileManagement.js.map +1 -1
- package/lib/module/ui/components/OxyPayButton.js +4 -2
- package/lib/module/ui/components/OxyPayButton.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +84 -83
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/SettingRow.js +11 -5
- package/lib/module/ui/components/SettingRow.js.map +1 -1
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js +76 -122
- package/lib/module/ui/components/fileManagement/FileDetailsModal.js.map +1 -1
- package/lib/module/ui/components/fileManagement/UploadPreview.js +32 -19
- package/lib/module/ui/components/fileManagement/UploadPreview.js.map +1 -1
- package/lib/module/ui/components/icon/OxyIcon.js +5 -4
- package/lib/module/ui/components/icon/OxyIcon.js.map +1 -1
- package/lib/module/ui/components/internal/GroupedPillButtons.js +11 -9
- package/lib/module/ui/components/internal/GroupedPillButtons.js.map +1 -1
- package/lib/module/ui/components/internal/PinInput.js +3 -2
- package/lib/module/ui/components/internal/PinInput.js.map +1 -1
- package/lib/module/ui/components/modals/DeleteAccountModal.js +83 -220
- package/lib/module/ui/components/modals/DeleteAccountModal.js.map +1 -1
- package/lib/module/ui/constants/theme.js +2 -2
- package/lib/module/ui/constants/theme.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +11 -10
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +71 -80
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +22 -10
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +140 -81
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountVerificationScreen.js +22 -10
- package/lib/module/ui/screens/AccountVerificationScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +85 -52
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/HistoryViewScreen.js +80 -101
- package/lib/module/ui/screens/HistoryViewScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +66 -94
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +101 -67
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/utils/fileManagement.js +0 -20
- package/lib/module/ui/utils/fileManagement.js.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts +0 -1
- package/lib/typescript/commonjs/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/SettingRow.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/SettingRow.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts +3 -4
- package/lib/typescript/commonjs/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts +2 -3
- package/lib/typescript/commonjs/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/icon/OxyIcon.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts +2 -2
- package/lib/typescript/commonjs/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts +0 -4
- package/lib/typescript/commonjs/ui/utils/fileManagement.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxyPayButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts +0 -1
- package/lib/typescript/module/ui/components/OxySignInButton.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/SettingRow.d.ts +2 -2
- package/lib/typescript/module/ui/components/SettingRow.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts +3 -4
- package/lib/typescript/module/ui/components/fileManagement/FileDetailsModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts +2 -3
- package/lib/typescript/module/ui/components/fileManagement/UploadPreview.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/icon/OxyIcon.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/internal/GroupedPillButtons.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/internal/PinInput.d.ts.map +1 -1
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts +2 -2
- package/lib/typescript/module/ui/components/modals/DeleteAccountModal.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountCenterScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountSwitcherScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/AccountVerificationScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/HistoryViewScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/PremiumSubscriptionScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/screens/SessionManagementScreen.d.ts.map +1 -1
- package/lib/typescript/module/ui/utils/fileManagement.d.ts +0 -4
- package/lib/typescript/module/ui/utils/fileManagement.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/ui/components/OxyPayButton.tsx +5 -3
- package/src/ui/components/OxySignInButton.tsx +82 -81
- package/src/ui/components/SettingRow.tsx +14 -7
- package/src/ui/components/fileManagement/FileDetailsModal.tsx +69 -99
- package/src/ui/components/fileManagement/UploadPreview.tsx +58 -46
- package/src/ui/components/icon/OxyIcon.tsx +5 -4
- package/src/ui/components/internal/GroupedPillButtons.tsx +15 -12
- package/src/ui/components/internal/PinInput.tsx +4 -3
- package/src/ui/components/modals/DeleteAccountModal.tsx +79 -221
- package/src/ui/constants/theme.ts +2 -2
- package/src/ui/screens/AccountCenterScreen.tsx +34 -136
- package/src/ui/screens/AccountOverviewScreen.tsx +63 -98
- package/src/ui/screens/AccountSettingsScreen.tsx +21 -7
- package/src/ui/screens/AccountSwitcherScreen.tsx +135 -87
- package/src/ui/screens/AccountVerificationScreen.tsx +24 -16
- package/src/ui/screens/FileManagementScreen.tsx +62 -54
- package/src/ui/screens/HistoryViewScreen.tsx +57 -204
- package/src/ui/screens/PremiumSubscriptionScreen.tsx +73 -93
- package/src/ui/screens/SessionManagementScreen.tsx +101 -73
- package/src/ui/utils/fileManagement.ts +0 -30
- package/lib/commonjs/ui/utils/confirmAction.js +0 -28
- package/lib/commonjs/ui/utils/confirmAction.js.map +0 -1
- package/lib/module/ui/utils/confirmAction.js +0 -25
- package/lib/module/ui/utils/confirmAction.js.map +0 -1
- package/lib/typescript/commonjs/ui/utils/confirmAction.d.ts +0 -7
- package/lib/typescript/commonjs/ui/utils/confirmAction.d.ts.map +0 -1
- package/lib/typescript/module/ui/utils/confirmAction.d.ts +0 -7
- package/lib/typescript/module/ui/utils/confirmAction.d.ts.map +0 -1
- package/src/ui/utils/confirmAction.ts +0 -23
|
@@ -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
|
|
4
|
+
import { View, Text, TouchableOpacity, StyleSheet, ScrollView, ActivityIndicator, RefreshControl, TextInput, Image, Animated, Easing } from 'react-native';
|
|
5
5
|
import { Image as ExpoImage } from 'expo-image';
|
|
6
6
|
// Lazy load expo-document-picker (optional dependency)
|
|
7
7
|
// This allows the screen to work even if expo-document-picker is not installed
|
|
@@ -16,6 +16,8 @@ const loadDocumentPicker = async () => {
|
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
18
|
import { toast } from '../../lib/sonner';
|
|
19
|
+
import * as Prompt from '@oxyhq/bloom/prompt';
|
|
20
|
+
import { usePromptControl } from '@oxyhq/bloom/prompt';
|
|
19
21
|
import { Ionicons } from '@expo/vector-icons';
|
|
20
22
|
// @ts-ignore - MaterialCommunityIcons is available at runtime
|
|
21
23
|
import { MaterialCommunityIcons } from '@expo/vector-icons';
|
|
@@ -27,10 +29,11 @@ import { useTheme } from '@oxyhq/bloom/theme';
|
|
|
27
29
|
import { useOxy } from "../context/OxyContext.js";
|
|
28
30
|
import { useI18n } from "../hooks/useI18n.js";
|
|
29
31
|
import { useUploadFile } from "../hooks/mutations/useAccountMutations.js";
|
|
30
|
-
import {
|
|
32
|
+
import { convertDocumentPickerAssetToFile, formatFileSize, getFileIcon, getSafeDownloadUrl } from "../utils/fileManagement.js";
|
|
31
33
|
import { FileViewer } from "../components/fileManagement/FileViewer.js";
|
|
32
34
|
import { FileDetailsModal } from "../components/fileManagement/FileDetailsModal.js";
|
|
33
35
|
import { UploadPreview } from "../components/fileManagement/UploadPreview.js";
|
|
36
|
+
import { useDialogControl } from '@oxyhq/bloom/dialog';
|
|
34
37
|
import { fileManagementStyles } from "../components/fileManagement/styles.js";
|
|
35
38
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
36
39
|
/** Extract error message from unknown error type */
|
|
@@ -108,6 +111,11 @@ const FileManagementScreen = ({
|
|
|
108
111
|
t
|
|
109
112
|
} = useI18n();
|
|
110
113
|
const uploadFileMutation = useUploadFile();
|
|
114
|
+
// Prompt controls
|
|
115
|
+
const fileDeletePrompt = usePromptControl();
|
|
116
|
+
const bulkDeletePrompt = usePromptControl();
|
|
117
|
+
const visibilityChangePrompt = usePromptControl();
|
|
118
|
+
const [pendingDeleteFile, setPendingDeleteFile] = useState(null);
|
|
111
119
|
const files = useFiles();
|
|
112
120
|
// Ensure containerWidth is a number (TypeScript guard)
|
|
113
121
|
const safeContainerWidth = typeof containerWidth === 'number' ? containerWidth : 400;
|
|
@@ -124,7 +132,7 @@ const FileManagementScreen = ({
|
|
|
124
132
|
loadingMore: false
|
|
125
133
|
});
|
|
126
134
|
const [selectedFile, setSelectedFile] = useState(null);
|
|
127
|
-
const
|
|
135
|
+
const fileDetailsControl = useDialogControl();
|
|
128
136
|
// In selectMode we never open the detailed viewer
|
|
129
137
|
const [openedFile, setOpenedFile] = useState(null);
|
|
130
138
|
const [fileContent, setFileContent] = useState(null);
|
|
@@ -863,14 +871,18 @@ const FileManagementScreen = ({
|
|
|
863
871
|
setIsPickingDocument(false);
|
|
864
872
|
}
|
|
865
873
|
};
|
|
866
|
-
const
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
filename
|
|
870
|
-
})
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
+
const confirmFileDelete = useCallback((fileId, filename) => {
|
|
875
|
+
setPendingDeleteFile({
|
|
876
|
+
id: fileId,
|
|
877
|
+
name: filename
|
|
878
|
+
});
|
|
879
|
+
fileDeletePrompt.open();
|
|
880
|
+
}, [fileDeletePrompt]);
|
|
881
|
+
const handleFileDelete = useCallback(async () => {
|
|
882
|
+
if (!pendingDeleteFile) return;
|
|
883
|
+
const {
|
|
884
|
+
id: fileId
|
|
885
|
+
} = pendingDeleteFile;
|
|
874
886
|
try {
|
|
875
887
|
storeSetDeleting(fileId);
|
|
876
888
|
await oxyServices.deleteFile(fileId);
|
|
@@ -894,19 +906,15 @@ const FileManagementScreen = ({
|
|
|
894
906
|
}
|
|
895
907
|
} finally {
|
|
896
908
|
storeSetDeleting(null);
|
|
909
|
+
setPendingDeleteFile(null);
|
|
897
910
|
}
|
|
898
|
-
};
|
|
911
|
+
}, [pendingDeleteFile, storeSetDeleting, oxyServices, loadFiles, t]);
|
|
912
|
+
const confirmBulkDelete = useCallback(() => {
|
|
913
|
+
if (selectedIds.size === 0) return;
|
|
914
|
+
bulkDeletePrompt.open();
|
|
915
|
+
}, [selectedIds.size, bulkDeletePrompt]);
|
|
899
916
|
const handleBulkDelete = useCallback(async () => {
|
|
900
917
|
if (selectedIds.size === 0) return;
|
|
901
|
-
const fileMap = {};
|
|
902
|
-
files.forEach(f => {
|
|
903
|
-
fileMap[f.id] = f;
|
|
904
|
-
});
|
|
905
|
-
const selectedFiles = Array.from(selectedIds).map(id => fileMap[id]).filter(Boolean);
|
|
906
|
-
const confirmed = await confirmAction(t('fileManagement.confirms.deleteFiles', {
|
|
907
|
-
count: selectedFiles.length
|
|
908
|
-
}), t('fileManagement.deleteFiles'), t('fileManagement.confirm'), t('common.cancel'));
|
|
909
|
-
if (!confirmed) return;
|
|
910
918
|
try {
|
|
911
919
|
const deletePromises = Array.from(selectedIds).map(async fileId => {
|
|
912
920
|
try {
|
|
@@ -1081,7 +1089,7 @@ const FileManagementScreen = ({
|
|
|
1081
1089
|
};
|
|
1082
1090
|
const showFileDetailsModal = file => {
|
|
1083
1091
|
setSelectedFile(file);
|
|
1084
|
-
|
|
1092
|
+
fileDetailsControl.open();
|
|
1085
1093
|
};
|
|
1086
1094
|
const renderSimplePhotoItem = useCallback((photo, index) => {
|
|
1087
1095
|
const downloadUrl = getSafeDownloadUrlCallback(photo, 'thumb');
|
|
@@ -1325,9 +1333,7 @@ const FileManagementScreen = ({
|
|
|
1325
1333
|
style: [fileManagementStyles.actionButton, {
|
|
1326
1334
|
backgroundColor: bloomTheme.isDark ? '#400000' : '#FFEBEE'
|
|
1327
1335
|
}],
|
|
1328
|
-
onPress: () =>
|
|
1329
|
-
handleFileDelete(file.id, file.filename);
|
|
1330
|
-
},
|
|
1336
|
+
onPress: () => confirmFileDelete(file.id, file.filename),
|
|
1331
1337
|
disabled: deleting === file.id,
|
|
1332
1338
|
children: deleting === file.id ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
1333
1339
|
size: "small",
|
|
@@ -1504,7 +1510,7 @@ const FileManagementScreen = ({
|
|
|
1504
1510
|
style: [fileManagementStyles.groupedActionBtn, {
|
|
1505
1511
|
backgroundColor: bloomTheme.isDark ? '#400000' : '#FFEBEE'
|
|
1506
1512
|
}],
|
|
1507
|
-
onPress: () =>
|
|
1513
|
+
onPress: () => confirmFileDelete(file.id, file.filename),
|
|
1508
1514
|
disabled: deleting === file.id,
|
|
1509
1515
|
children: deleting === file.id ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
1510
1516
|
size: "small",
|
|
@@ -1525,7 +1531,7 @@ const FileManagementScreen = ({
|
|
|
1525
1531
|
}) : undefined
|
|
1526
1532
|
};
|
|
1527
1533
|
});
|
|
1528
|
-
}, [filteredFiles, theme, deleting, handleFileDownload,
|
|
1534
|
+
}, [filteredFiles, theme, deleting, handleFileDownload, confirmFileDelete, handleFileOpen, getSafeDownloadUrlCallback, selectMode, selectedIds]);
|
|
1529
1535
|
|
|
1530
1536
|
// Scroll to selected file after selection
|
|
1531
1537
|
useEffect(() => {
|
|
@@ -2001,14 +2007,13 @@ const FileManagementScreen = ({
|
|
|
2001
2007
|
onToggleDetails: () => setShowFileDetailsInViewer(!showFileDetailsInViewer),
|
|
2002
2008
|
onClose: handleCloseFile,
|
|
2003
2009
|
onDownload: handleFileDownload,
|
|
2004
|
-
onDelete:
|
|
2010
|
+
onDelete: confirmFileDelete,
|
|
2005
2011
|
isOwner: user?.id === targetUserId
|
|
2006
2012
|
}), /*#__PURE__*/_jsx(FileDetailsModal, {
|
|
2007
|
-
|
|
2013
|
+
control: fileDetailsControl,
|
|
2008
2014
|
file: selectedFile,
|
|
2009
|
-
onClose: () => setShowFileDetails(false),
|
|
2010
2015
|
onDownload: handleFileDownload,
|
|
2011
|
-
onDelete:
|
|
2016
|
+
onDelete: confirmFileDelete,
|
|
2012
2017
|
isOwner: user?.id === targetUserId
|
|
2013
2018
|
})]
|
|
2014
2019
|
});
|
|
@@ -2029,7 +2034,6 @@ const FileManagementScreen = ({
|
|
|
2029
2034
|
elevation: "none",
|
|
2030
2035
|
titleAlignment: "left"
|
|
2031
2036
|
}), /*#__PURE__*/_jsx(UploadPreview, {
|
|
2032
|
-
visible: true,
|
|
2033
2037
|
pendingFiles: pendingFiles,
|
|
2034
2038
|
onConfirm: handleConfirmUpload,
|
|
2035
2039
|
onCancel: handleCancelUpload,
|
|
@@ -2073,28 +2077,13 @@ const FileManagementScreen = ({
|
|
|
2073
2077
|
text: t('fileManagement.delete', {
|
|
2074
2078
|
count: selectedIds.size
|
|
2075
2079
|
}),
|
|
2076
|
-
onPress:
|
|
2080
|
+
onPress: confirmBulkDelete,
|
|
2077
2081
|
icon: 'delete'
|
|
2078
2082
|
}, {
|
|
2079
2083
|
key: 'visibility',
|
|
2080
2084
|
text: t('fileManagement.visibility'),
|
|
2081
2085
|
onPress: () => {
|
|
2082
|
-
|
|
2083
|
-
Alert.alert(t('fileManagement.changeVisibility'), t('fileManagement.changeVisibilityConfirm', {
|
|
2084
|
-
count: selectedIds.size
|
|
2085
|
-
}), [{
|
|
2086
|
-
text: t('common.cancel'),
|
|
2087
|
-
style: 'cancel'
|
|
2088
|
-
}, {
|
|
2089
|
-
text: t('fileManagement.private'),
|
|
2090
|
-
onPress: () => handleBulkVisibilityChange('private')
|
|
2091
|
-
}, {
|
|
2092
|
-
text: t('fileManagement.public'),
|
|
2093
|
-
onPress: () => handleBulkVisibilityChange('public')
|
|
2094
|
-
}, {
|
|
2095
|
-
text: t('fileManagement.unlisted'),
|
|
2096
|
-
onPress: () => handleBulkVisibilityChange('unlisted')
|
|
2097
|
-
}]);
|
|
2086
|
+
visibilityChangePrompt.open();
|
|
2098
2087
|
},
|
|
2099
2088
|
icon: 'eye'
|
|
2100
2089
|
}] : undefined,
|
|
@@ -2339,11 +2328,10 @@ const FileManagementScreen = ({
|
|
|
2339
2328
|
})]
|
|
2340
2329
|
})
|
|
2341
2330
|
}), !selectMode && /*#__PURE__*/_jsx(FileDetailsModal, {
|
|
2342
|
-
|
|
2331
|
+
control: fileDetailsControl,
|
|
2343
2332
|
file: selectedFile,
|
|
2344
|
-
onClose: () => setShowFileDetails(false),
|
|
2345
2333
|
onDownload: handleFileDownload,
|
|
2346
|
-
onDelete:
|
|
2334
|
+
onDelete: confirmFileDelete,
|
|
2347
2335
|
isOwner: user?.id === targetUserId
|
|
2348
2336
|
}), !selectMode && uploading && /*#__PURE__*/_jsx(View, {
|
|
2349
2337
|
style: [fileManagementStyles.uploadBannerContainer, {
|
|
@@ -2381,6 +2369,51 @@ const FileManagementScreen = ({
|
|
|
2381
2369
|
color: colors.primary
|
|
2382
2370
|
})]
|
|
2383
2371
|
})
|
|
2372
|
+
}), /*#__PURE__*/_jsx(Prompt.Basic, {
|
|
2373
|
+
control: fileDeletePrompt,
|
|
2374
|
+
title: t('fileManagement.deleteFile') || 'Delete File',
|
|
2375
|
+
description: pendingDeleteFile ? t('fileManagement.confirms.deleteFile', {
|
|
2376
|
+
filename: pendingDeleteFile.name
|
|
2377
|
+
}) : '',
|
|
2378
|
+
onConfirm: handleFileDelete,
|
|
2379
|
+
confirmButtonCta: t('fileManagement.confirm') || 'Delete',
|
|
2380
|
+
confirmButtonColor: "negative"
|
|
2381
|
+
}), /*#__PURE__*/_jsx(Prompt.Basic, {
|
|
2382
|
+
control: bulkDeletePrompt,
|
|
2383
|
+
title: t('fileManagement.deleteFiles') || 'Delete Files',
|
|
2384
|
+
description: t('fileManagement.confirms.deleteFiles', {
|
|
2385
|
+
count: selectedIds.size
|
|
2386
|
+
}),
|
|
2387
|
+
onConfirm: handleBulkDelete,
|
|
2388
|
+
confirmButtonCta: t('fileManagement.confirm') || 'Delete',
|
|
2389
|
+
confirmButtonColor: "negative"
|
|
2390
|
+
}), /*#__PURE__*/_jsxs(Prompt.Outer, {
|
|
2391
|
+
control: visibilityChangePrompt,
|
|
2392
|
+
children: [/*#__PURE__*/_jsxs(Prompt.Content, {
|
|
2393
|
+
children: [/*#__PURE__*/_jsx(Prompt.TitleText, {
|
|
2394
|
+
children: t('fileManagement.changeVisibility') || 'Change Visibility'
|
|
2395
|
+
}), /*#__PURE__*/_jsx(Prompt.DescriptionText, {
|
|
2396
|
+
children: t('fileManagement.changeVisibilityConfirm', {
|
|
2397
|
+
count: selectedIds.size
|
|
2398
|
+
})
|
|
2399
|
+
})]
|
|
2400
|
+
}), /*#__PURE__*/_jsxs(Prompt.Actions, {
|
|
2401
|
+
children: [/*#__PURE__*/_jsx(Prompt.Action, {
|
|
2402
|
+
cta: t('fileManagement.private') || 'Private',
|
|
2403
|
+
onPress: () => handleBulkVisibilityChange('private'),
|
|
2404
|
+
color: "primary"
|
|
2405
|
+
}), /*#__PURE__*/_jsx(Prompt.Action, {
|
|
2406
|
+
cta: t('fileManagement.public') || 'Public',
|
|
2407
|
+
onPress: () => handleBulkVisibilityChange('public'),
|
|
2408
|
+
color: "primary_subtle"
|
|
2409
|
+
}), /*#__PURE__*/_jsx(Prompt.Action, {
|
|
2410
|
+
cta: t('fileManagement.unlisted') || 'Unlisted',
|
|
2411
|
+
onPress: () => handleBulkVisibilityChange('unlisted'),
|
|
2412
|
+
color: "primary_subtle"
|
|
2413
|
+
}), /*#__PURE__*/_jsx(Prompt.Cancel, {
|
|
2414
|
+
cta: t('common.cancel') || 'Cancel'
|
|
2415
|
+
})]
|
|
2416
|
+
})]
|
|
2384
2417
|
})]
|
|
2385
2418
|
});
|
|
2386
2419
|
};
|