@oxyhq/services 5.4.1 → 5.4.3
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/assets/icons/OxyServices.js +1 -1
- package/lib/commonjs/core/index.js +84 -2
- package/lib/commonjs/core/index.js.map +1 -1
- package/lib/commonjs/index.js +22 -22
- package/lib/commonjs/index.js.map +1 -1
- package/lib/commonjs/node/index.js +6 -6
- package/lib/commonjs/node/index.js.map +1 -1
- package/lib/commonjs/ui/components/Avatar.js +3 -3
- package/lib/commonjs/ui/components/Avatar.js.map +1 -1
- package/lib/commonjs/ui/components/FollowButton.js +3 -3
- package/lib/commonjs/ui/components/GroupedSection.js +1 -1
- package/lib/commonjs/ui/components/OxyLogo.js +1 -1
- package/lib/commonjs/ui/components/OxyProvider.js +13 -13
- package/lib/commonjs/ui/components/OxyProvider.js.map +1 -1
- package/lib/commonjs/ui/components/OxySignInButton.js +2 -2
- package/lib/commonjs/ui/components/ProfileCard.js +2 -2
- package/lib/commonjs/ui/components/Section.js +1 -1
- package/lib/commonjs/ui/components/SectionTitle.js +1 -1
- package/lib/commonjs/ui/components/icon/index.js +1 -1
- package/lib/commonjs/ui/components/index.js +12 -12
- package/lib/commonjs/ui/context/OxyContext.js +20 -4
- package/lib/commonjs/ui/context/OxyContext.js.map +1 -1
- package/lib/commonjs/ui/index.js +11 -11
- package/lib/commonjs/ui/index.js.map +1 -1
- package/lib/commonjs/ui/navigation/OxyRouter.js +18 -18
- package/lib/commonjs/ui/screens/AccountCenterScreen.js +18 -18
- package/lib/commonjs/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountManagementDemo.js +3 -3
- package/lib/commonjs/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js +45 -27
- package/lib/commonjs/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js +29 -22
- package/lib/commonjs/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/AccountSwitcherScreen.js +3 -3
- package/lib/commonjs/ui/screens/AppInfoScreen.js +6 -6
- package/lib/commonjs/ui/screens/BillingManagementScreen.js +3 -3
- package/lib/commonjs/ui/screens/FileManagementScreen.js +324 -306
- package/lib/commonjs/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/PremiumSubscriptionScreen.js +3 -3
- package/lib/commonjs/ui/screens/ProfileScreen.js +2 -2
- package/lib/commonjs/ui/screens/SessionManagementScreen.js +2 -2
- package/lib/commonjs/ui/screens/SignInScreen.js +358 -310
- package/lib/commonjs/ui/screens/SignInScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/SignUpScreen.js +483 -308
- package/lib/commonjs/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaCenterScreen.js +3 -3
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js +51 -26
- package/lib/commonjs/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/commonjs/ui/screens/karma/KarmaLeaderboardScreen.js +2 -2
- package/lib/commonjs/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/commonjs/ui/styles/index.js +2 -2
- package/lib/commonjs/ui/styles/theme.js +1 -1
- package/lib/commonjs/utils/index.js +1 -1
- package/lib/module/assets/icons/OxyServices.js +1 -1
- package/lib/module/assets/icons/OxyServices.js.map +1 -1
- package/lib/module/core/index.js +84 -2
- package/lib/module/core/index.js.map +1 -1
- package/lib/module/index.js +10 -10
- package/lib/module/index.js.map +1 -1
- package/lib/module/node/index.js +4 -4
- package/lib/module/node/index.js.map +1 -1
- package/lib/module/ui/components/Avatar.js +2 -2
- package/lib/module/ui/components/Avatar.js.map +1 -1
- package/lib/module/ui/components/FollowButton.js +3 -3
- package/lib/module/ui/components/FollowButton.js.map +1 -1
- package/lib/module/ui/components/GroupedSection.js +1 -1
- package/lib/module/ui/components/GroupedSection.js.map +1 -1
- package/lib/module/ui/components/OxyLogo.js +1 -1
- package/lib/module/ui/components/OxyLogo.js.map +1 -1
- package/lib/module/ui/components/OxyProvider.js +10 -10
- package/lib/module/ui/components/OxyProvider.js.map +1 -1
- package/lib/module/ui/components/OxySignInButton.js +2 -2
- package/lib/module/ui/components/OxySignInButton.js.map +1 -1
- package/lib/module/ui/components/ProfileCard.js +2 -2
- package/lib/module/ui/components/ProfileCard.js.map +1 -1
- package/lib/module/ui/components/Section.js +1 -1
- package/lib/module/ui/components/Section.js.map +1 -1
- package/lib/module/ui/components/SectionTitle.js +1 -1
- package/lib/module/ui/components/SectionTitle.js.map +1 -1
- package/lib/module/ui/components/icon/index.js +1 -1
- package/lib/module/ui/components/icon/index.js.map +1 -1
- package/lib/module/ui/components/index.js +12 -12
- package/lib/module/ui/components/index.js.map +1 -1
- package/lib/module/ui/context/OxyContext.js +20 -4
- package/lib/module/ui/context/OxyContext.js.map +1 -1
- package/lib/module/ui/index.js +10 -10
- package/lib/module/ui/index.js.map +1 -1
- package/lib/module/ui/navigation/OxyRouter.js +18 -18
- package/lib/module/ui/navigation/OxyRouter.js.map +1 -1
- package/lib/module/ui/screens/AccountCenterScreen.js +5 -5
- package/lib/module/ui/screens/AccountCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountManagementDemo.js +2 -2
- package/lib/module/ui/screens/AccountManagementDemo.js.map +1 -1
- package/lib/module/ui/screens/AccountOverviewScreen.js +46 -28
- package/lib/module/ui/screens/AccountOverviewScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSettingsScreen.js +30 -23
- package/lib/module/ui/screens/AccountSettingsScreen.js.map +1 -1
- package/lib/module/ui/screens/AccountSwitcherScreen.js +3 -3
- package/lib/module/ui/screens/AccountSwitcherScreen.js.map +1 -1
- package/lib/module/ui/screens/AppInfoScreen.js +6 -6
- package/lib/module/ui/screens/AppInfoScreen.js.map +1 -1
- package/lib/module/ui/screens/BillingManagementScreen.js +3 -3
- package/lib/module/ui/screens/BillingManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/FileManagementScreen.js +325 -307
- package/lib/module/ui/screens/FileManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js +3 -3
- package/lib/module/ui/screens/PremiumSubscriptionScreen.js.map +1 -1
- package/lib/module/ui/screens/ProfileScreen.js +2 -2
- package/lib/module/ui/screens/ProfileScreen.js.map +1 -1
- package/lib/module/ui/screens/SessionManagementScreen.js +2 -2
- package/lib/module/ui/screens/SessionManagementScreen.js.map +1 -1
- package/lib/module/ui/screens/SignInScreen.js +358 -310
- package/lib/module/ui/screens/SignInScreen.js.map +1 -1
- package/lib/module/ui/screens/SignUpScreen.js +486 -309
- package/lib/module/ui/screens/SignUpScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js +3 -3
- package/lib/module/ui/screens/karma/KarmaCenterScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js +52 -27
- package/lib/module/ui/screens/karma/KarmaFAQScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js +2 -2
- package/lib/module/ui/screens/karma/KarmaLeaderboardScreen.js.map +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js +1 -1
- package/lib/module/ui/screens/karma/KarmaRulesScreen.js.map +1 -1
- package/lib/module/ui/styles/index.js +2 -2
- package/lib/module/ui/styles/index.js.map +1 -1
- package/lib/module/ui/styles/theme.js +1 -1
- package/lib/module/ui/styles/theme.js.map +1 -1
- package/lib/module/utils/index.js +1 -1
- package/lib/module/utils/index.js.map +1 -1
- package/lib/typescript/core/index.d.ts +24 -0
- package/lib/typescript/core/index.d.ts.map +1 -1
- package/lib/typescript/ui/components/OxyProvider.d.ts.map +1 -1
- package/lib/typescript/ui/context/OxyContext.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/AccountOverviewScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/AccountSettingsScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/FileManagementScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignInScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/SignUpScreen.d.ts.map +1 -1
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts +2 -2
- package/lib/typescript/ui/screens/karma/KarmaFAQScreen.d.ts.map +1 -1
- package/package.json +21 -5
- package/src/core/index.ts +68 -0
- package/src/ui/components/OxyProvider.tsx +5 -5
- package/src/ui/context/OxyContext.tsx +61 -41
- package/src/ui/screens/AccountOverviewScreen.tsx +44 -26
- package/src/ui/screens/AccountSettingsScreen.tsx +24 -18
- package/src/ui/screens/FileManagementScreen.tsx +246 -211
- package/src/ui/screens/SignInScreen.tsx +382 -326
- package/src/ui/screens/SignUpScreen.tsx +443 -273
- package/src/ui/screens/karma/KarmaFAQScreen.tsx +50 -29
- package/lib/commonjs/package.json +0 -1
- package/lib/module/package.json +0 -1
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
import React, { useState, useEffect, useCallback } from 'react';
|
|
3
|
+
import React, { useState, useEffect, useCallback, useMemo } from 'react';
|
|
4
4
|
import { View, Text, TouchableOpacity, StyleSheet, ScrollView, ActivityIndicator, Platform, RefreshControl, Modal, TextInput, Image } from 'react-native';
|
|
5
|
-
import { useOxy } from
|
|
6
|
-
import { fontFamilies } from
|
|
7
|
-
import { toast } from
|
|
5
|
+
import { useOxy } from "../context/OxyContext.js";
|
|
6
|
+
import { fontFamilies } from "../styles/fonts.js";
|
|
7
|
+
import { toast } from "../../lib/sonner.js";
|
|
8
8
|
import { Ionicons } from '@expo/vector-icons';
|
|
9
9
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
10
10
|
const FileManagementScreen = ({
|
|
@@ -50,14 +50,25 @@ const FileManagementScreen = ({
|
|
|
50
50
|
const [photoDimensions, setPhotoDimensions] = useState({});
|
|
51
51
|
const [loadingDimensions, setLoadingDimensions] = useState(false);
|
|
52
52
|
const [hoveredPreview, setHoveredPreview] = useState(null);
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
const
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
53
|
+
|
|
54
|
+
// Memoize theme-related calculations to prevent unnecessary recalculations
|
|
55
|
+
const themeStyles = useMemo(() => {
|
|
56
|
+
const isDarkTheme = theme === 'dark';
|
|
57
|
+
return {
|
|
58
|
+
isDarkTheme,
|
|
59
|
+
textColor: isDarkTheme ? '#FFFFFF' : '#000000',
|
|
60
|
+
backgroundColor: isDarkTheme ? '#121212' : '#f2f2f2',
|
|
61
|
+
secondaryBackgroundColor: isDarkTheme ? '#222222' : '#FFFFFF',
|
|
62
|
+
borderColor: isDarkTheme ? '#444444' : '#E0E0E0',
|
|
63
|
+
primaryColor: '#007AFF',
|
|
64
|
+
dangerColor: '#FF3B30',
|
|
65
|
+
successColor: '#34C759'
|
|
66
|
+
};
|
|
67
|
+
}, [theme]);
|
|
68
|
+
|
|
69
|
+
// Extract commonly used theme variables
|
|
70
|
+
const backgroundColor = themeStyles.backgroundColor;
|
|
71
|
+
const borderColor = themeStyles.borderColor;
|
|
61
72
|
const targetUserId = userId || user?.id;
|
|
62
73
|
const loadFiles = useCallback(async (isRefresh = false) => {
|
|
63
74
|
if (!targetUserId) return;
|
|
@@ -179,7 +190,7 @@ const FileManagementScreen = ({
|
|
|
179
190
|
}, [oxyServices, photoDimensions]);
|
|
180
191
|
|
|
181
192
|
// Create justified rows from photos with responsive algorithm
|
|
182
|
-
const createJustifiedRows = useCallback(photos => {
|
|
193
|
+
const createJustifiedRows = useCallback((photos, containerWidth) => {
|
|
183
194
|
if (photos.length === 0) return [];
|
|
184
195
|
const rows = [];
|
|
185
196
|
const photosPerRow = 3; // Fixed 3 photos per row for consistency
|
|
@@ -609,9 +620,10 @@ const FileManagementScreen = ({
|
|
|
609
620
|
const isVideo = file.contentType.startsWith('video/');
|
|
610
621
|
const isAudio = file.contentType.startsWith('audio/');
|
|
611
622
|
const hasPreview = isImage || isPDF || isVideo;
|
|
623
|
+
const borderColor = themeStyles.borderColor;
|
|
612
624
|
return /*#__PURE__*/_jsxs(View, {
|
|
613
625
|
style: [styles.fileItem, {
|
|
614
|
-
backgroundColor: secondaryBackgroundColor,
|
|
626
|
+
backgroundColor: themeStyles.secondaryBackgroundColor,
|
|
615
627
|
borderColor
|
|
616
628
|
}],
|
|
617
629
|
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
@@ -658,10 +670,10 @@ const FileManagementScreen = ({
|
|
|
658
670
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
659
671
|
name: "document",
|
|
660
672
|
size: 32,
|
|
661
|
-
color: primaryColor
|
|
673
|
+
color: themeStyles.primaryColor
|
|
662
674
|
}), /*#__PURE__*/_jsx(Text, {
|
|
663
675
|
style: [styles.pdfLabel, {
|
|
664
|
-
color: primaryColor
|
|
676
|
+
color: themeStyles.primaryColor
|
|
665
677
|
}],
|
|
666
678
|
children: "PDF"
|
|
667
679
|
})]
|
|
@@ -670,10 +682,10 @@ const FileManagementScreen = ({
|
|
|
670
682
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
671
683
|
name: "play-circle",
|
|
672
684
|
size: 32,
|
|
673
|
-
color: primaryColor
|
|
685
|
+
color: themeStyles.primaryColor
|
|
674
686
|
}), /*#__PURE__*/_jsx(Text, {
|
|
675
687
|
style: [styles.videoLabel, {
|
|
676
|
-
color: primaryColor
|
|
688
|
+
color: themeStyles.primaryColor
|
|
677
689
|
}],
|
|
678
690
|
children: "VIDEO"
|
|
679
691
|
})]
|
|
@@ -687,7 +699,7 @@ const FileManagementScreen = ({
|
|
|
687
699
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
688
700
|
name: getFileIcon(file.contentType),
|
|
689
701
|
size: 32,
|
|
690
|
-
color: primaryColor
|
|
702
|
+
color: themeStyles.primaryColor
|
|
691
703
|
})
|
|
692
704
|
}), Platform.OS === 'web' && hoveredPreview === file.id && isImage && /*#__PURE__*/_jsx(View, {
|
|
693
705
|
style: styles.previewOverlay,
|
|
@@ -702,25 +714,25 @@ const FileManagementScreen = ({
|
|
|
702
714
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
703
715
|
name: getFileIcon(file.contentType),
|
|
704
716
|
size: 32,
|
|
705
|
-
color: primaryColor
|
|
717
|
+
color: themeStyles.primaryColor
|
|
706
718
|
})
|
|
707
719
|
})
|
|
708
720
|
}), /*#__PURE__*/_jsxs(View, {
|
|
709
721
|
style: styles.fileInfo,
|
|
710
722
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
711
723
|
style: [styles.fileName, {
|
|
712
|
-
color: textColor
|
|
724
|
+
color: themeStyles.textColor
|
|
713
725
|
}],
|
|
714
726
|
numberOfLines: 1,
|
|
715
727
|
children: file.filename
|
|
716
728
|
}), /*#__PURE__*/_jsxs(Text, {
|
|
717
729
|
style: [styles.fileDetails, {
|
|
718
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
730
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
719
731
|
}],
|
|
720
732
|
children: [formatFileSize(file.length), " \u2022 ", new Date(file.uploadDate).toLocaleDateString()]
|
|
721
733
|
}), file.metadata?.description && /*#__PURE__*/_jsx(Text, {
|
|
722
734
|
style: [styles.fileDescription, {
|
|
723
|
-
color: isDarkTheme ? '#AAAAAA' : '#888888'
|
|
735
|
+
color: themeStyles.isDarkTheme ? '#AAAAAA' : '#888888'
|
|
724
736
|
}],
|
|
725
737
|
numberOfLines: 2,
|
|
726
738
|
children: file.metadata.description
|
|
@@ -730,27 +742,27 @@ const FileManagementScreen = ({
|
|
|
730
742
|
style: styles.fileActions,
|
|
731
743
|
children: [hasPreview && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
732
744
|
style: [styles.actionButton, {
|
|
733
|
-
backgroundColor: isDarkTheme ? '#333333' : '#F0F0F0'
|
|
745
|
+
backgroundColor: themeStyles.isDarkTheme ? '#333333' : '#F0F0F0'
|
|
734
746
|
}],
|
|
735
747
|
onPress: () => handleFileOpen(file),
|
|
736
748
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
737
749
|
name: "eye",
|
|
738
750
|
size: 20,
|
|
739
|
-
color: primaryColor
|
|
751
|
+
color: themeStyles.primaryColor
|
|
740
752
|
})
|
|
741
753
|
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
742
754
|
style: [styles.actionButton, {
|
|
743
|
-
backgroundColor: isDarkTheme ? '#333333' : '#F0F0F0'
|
|
755
|
+
backgroundColor: themeStyles.isDarkTheme ? '#333333' : '#F0F0F0'
|
|
744
756
|
}],
|
|
745
757
|
onPress: () => handleFileDownload(file.id, file.filename),
|
|
746
758
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
747
759
|
name: "download",
|
|
748
760
|
size: 20,
|
|
749
|
-
color: primaryColor
|
|
761
|
+
color: themeStyles.primaryColor
|
|
750
762
|
})
|
|
751
763
|
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
752
764
|
style: [styles.actionButton, {
|
|
753
|
-
backgroundColor: isDarkTheme ? '#400000' : '#FFEBEE'
|
|
765
|
+
backgroundColor: themeStyles.isDarkTheme ? '#400000' : '#FFEBEE'
|
|
754
766
|
}],
|
|
755
767
|
onPress: () => {
|
|
756
768
|
handleFileDelete(file.id, file.filename);
|
|
@@ -758,16 +770,72 @@ const FileManagementScreen = ({
|
|
|
758
770
|
disabled: deleting === file.id,
|
|
759
771
|
children: deleting === file.id ? /*#__PURE__*/_jsx(ActivityIndicator, {
|
|
760
772
|
size: "small",
|
|
761
|
-
color: dangerColor
|
|
773
|
+
color: themeStyles.dangerColor
|
|
762
774
|
}) : /*#__PURE__*/_jsx(Ionicons, {
|
|
763
775
|
name: "trash",
|
|
764
776
|
size: 20,
|
|
765
|
-
color: dangerColor
|
|
777
|
+
color: themeStyles.dangerColor
|
|
766
778
|
})
|
|
767
779
|
})]
|
|
768
780
|
})]
|
|
769
781
|
}, file.id);
|
|
770
782
|
};
|
|
783
|
+
const renderPhotoItem = (photo, index) => {
|
|
784
|
+
const downloadUrl = oxyServices.getFileDownloadUrl(photo.id);
|
|
785
|
+
|
|
786
|
+
// Calculate photo item width based on actual container size from bottom sheet
|
|
787
|
+
let itemsPerRow = 3; // Default for mobile
|
|
788
|
+
if (containerWidth > 768) itemsPerRow = 6; // Tablet/Desktop
|
|
789
|
+
else if (containerWidth > 480) itemsPerRow = 4; // Large mobile
|
|
790
|
+
|
|
791
|
+
// Account for the photoScrollContainer padding (16px on each side = 32px total)
|
|
792
|
+
const scrollContainerPadding = 32; // Total horizontal padding from photoScrollContainer
|
|
793
|
+
const gaps = (itemsPerRow - 1) * 4; // Gap between items
|
|
794
|
+
const availableWidth = containerWidth - scrollContainerPadding;
|
|
795
|
+
const itemWidth = (availableWidth - gaps) / itemsPerRow;
|
|
796
|
+
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
797
|
+
style: [styles.photoItem, {
|
|
798
|
+
width: itemWidth,
|
|
799
|
+
height: itemWidth
|
|
800
|
+
}],
|
|
801
|
+
onPress: () => handleFileOpen(photo),
|
|
802
|
+
activeOpacity: 0.8,
|
|
803
|
+
children: /*#__PURE__*/_jsx(View, {
|
|
804
|
+
style: styles.photoContainer,
|
|
805
|
+
children: Platform.OS === 'web' ? /*#__PURE__*/_jsx("img", {
|
|
806
|
+
src: downloadUrl,
|
|
807
|
+
alt: photo.filename,
|
|
808
|
+
style: {
|
|
809
|
+
width: '100%',
|
|
810
|
+
height: '100%',
|
|
811
|
+
objectFit: 'cover',
|
|
812
|
+
borderRadius: 8,
|
|
813
|
+
transition: 'transform 0.2s ease'
|
|
814
|
+
},
|
|
815
|
+
loading: "lazy",
|
|
816
|
+
onError: e => {
|
|
817
|
+
console.error('Photo failed to load:', e);
|
|
818
|
+
// Could replace with placeholder image
|
|
819
|
+
},
|
|
820
|
+
onMouseEnter: e => {
|
|
821
|
+
e.currentTarget.style.transform = 'scale(1.02)';
|
|
822
|
+
},
|
|
823
|
+
onMouseLeave: e => {
|
|
824
|
+
e.currentTarget.style.transform = 'scale(1)';
|
|
825
|
+
}
|
|
826
|
+
}) : /*#__PURE__*/_jsx(Image, {
|
|
827
|
+
source: {
|
|
828
|
+
uri: downloadUrl
|
|
829
|
+
},
|
|
830
|
+
style: styles.photoImage,
|
|
831
|
+
resizeMode: "cover",
|
|
832
|
+
onError: e => {
|
|
833
|
+
console.error('Photo failed to load:', e);
|
|
834
|
+
}
|
|
835
|
+
})
|
|
836
|
+
})
|
|
837
|
+
}, photo.id);
|
|
838
|
+
};
|
|
771
839
|
const renderPhotoGrid = useCallback(() => {
|
|
772
840
|
const photos = filteredFiles.filter(file => file.contentType.startsWith('image/'));
|
|
773
841
|
if (photos.length === 0) {
|
|
@@ -776,20 +844,20 @@ const FileManagementScreen = ({
|
|
|
776
844
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
777
845
|
name: "images-outline",
|
|
778
846
|
size: 64,
|
|
779
|
-
color: isDarkTheme ? '#666666' : '#CCCCCC'
|
|
847
|
+
color: themeStyles.isDarkTheme ? '#666666' : '#CCCCCC'
|
|
780
848
|
}), /*#__PURE__*/_jsx(Text, {
|
|
781
849
|
style: [styles.emptyStateTitle, {
|
|
782
|
-
color: textColor
|
|
850
|
+
color: themeStyles.textColor
|
|
783
851
|
}],
|
|
784
852
|
children: "No Photos Yet"
|
|
785
853
|
}), /*#__PURE__*/_jsx(Text, {
|
|
786
854
|
style: [styles.emptyStateDescription, {
|
|
787
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
855
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
788
856
|
}],
|
|
789
857
|
children: user?.id === targetUserId ? `Upload photos to get started. You can select multiple photos at once${Platform.OS === 'web' ? ' or drag & drop them here.' : '.'}` : "This user hasn't uploaded any photos yet"
|
|
790
858
|
}), user?.id === targetUserId && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
791
859
|
style: [styles.emptyStateButton, {
|
|
792
|
-
backgroundColor: primaryColor
|
|
860
|
+
backgroundColor: themeStyles.primaryColor
|
|
793
861
|
}],
|
|
794
862
|
onPress: handleFileUpload,
|
|
795
863
|
disabled: uploading,
|
|
@@ -815,17 +883,17 @@ const FileManagementScreen = ({
|
|
|
815
883
|
refreshControl: /*#__PURE__*/_jsx(RefreshControl, {
|
|
816
884
|
refreshing: refreshing,
|
|
817
885
|
onRefresh: () => loadFiles(true),
|
|
818
|
-
tintColor: primaryColor
|
|
886
|
+
tintColor: themeStyles.primaryColor
|
|
819
887
|
}),
|
|
820
888
|
showsVerticalScrollIndicator: false,
|
|
821
889
|
children: [loadingDimensions && /*#__PURE__*/_jsxs(View, {
|
|
822
890
|
style: styles.dimensionsLoadingIndicator,
|
|
823
891
|
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
824
892
|
size: "small",
|
|
825
|
-
color: primaryColor
|
|
893
|
+
color: themeStyles.primaryColor
|
|
826
894
|
}), /*#__PURE__*/_jsx(Text, {
|
|
827
895
|
style: [styles.dimensionsLoadingText, {
|
|
828
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
896
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
829
897
|
}],
|
|
830
898
|
children: "Loading photo layout..."
|
|
831
899
|
})]
|
|
@@ -836,11 +904,11 @@ const FileManagementScreen = ({
|
|
|
836
904
|
createJustifiedRows: createJustifiedRows,
|
|
837
905
|
renderJustifiedPhotoItem: renderJustifiedPhotoItem,
|
|
838
906
|
renderSimplePhotoItem: renderPhotoItem,
|
|
839
|
-
textColor: textColor,
|
|
907
|
+
textColor: themeStyles.textColor,
|
|
840
908
|
containerWidth: containerWidth
|
|
841
909
|
})]
|
|
842
910
|
});
|
|
843
|
-
}, [filteredFiles,
|
|
911
|
+
}, [filteredFiles, themeStyles, user?.id, targetUserId, uploading, handleFileUpload, refreshing, loadFiles, loadingDimensions, photoDimensions, loadPhotoDimensions, createJustifiedRows, renderJustifiedPhotoItem, renderPhotoItem, containerWidth]);
|
|
844
912
|
|
|
845
913
|
// Separate component for the photo grid to optimize rendering
|
|
846
914
|
const JustifiedPhotoGrid = /*#__PURE__*/React.memo(({
|
|
@@ -880,7 +948,7 @@ const FileManagementScreen = ({
|
|
|
880
948
|
style: styles.photoDateSection,
|
|
881
949
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
882
950
|
style: [styles.photoDateHeader, {
|
|
883
|
-
color: textColor
|
|
951
|
+
color: themeStyles.textColor
|
|
884
952
|
}],
|
|
885
953
|
children: new Date(date).toLocaleDateString('en-US', {
|
|
886
954
|
weekday: 'long',
|
|
@@ -932,207 +1000,157 @@ const FileManagementScreen = ({
|
|
|
932
1000
|
})
|
|
933
1001
|
});
|
|
934
1002
|
});
|
|
935
|
-
const
|
|
936
|
-
const
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
const availableWidth = containerWidth - scrollContainerPadding;
|
|
947
|
-
const itemWidth = (availableWidth - gaps) / itemsPerRow;
|
|
948
|
-
return /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
949
|
-
style: [styles.photoItem, {
|
|
950
|
-
width: itemWidth,
|
|
951
|
-
height: itemWidth
|
|
952
|
-
}],
|
|
953
|
-
onPress: () => handleFileOpen(photo),
|
|
954
|
-
activeOpacity: 0.8,
|
|
955
|
-
children: /*#__PURE__*/_jsx(View, {
|
|
956
|
-
style: styles.photoContainer,
|
|
957
|
-
children: Platform.OS === 'web' ? /*#__PURE__*/_jsx("img", {
|
|
958
|
-
src: downloadUrl,
|
|
959
|
-
alt: photo.filename,
|
|
960
|
-
style: {
|
|
961
|
-
width: '100%',
|
|
962
|
-
height: '100%',
|
|
963
|
-
objectFit: 'cover',
|
|
964
|
-
borderRadius: 8,
|
|
965
|
-
transition: 'transform 0.2s ease'
|
|
966
|
-
},
|
|
967
|
-
loading: "lazy",
|
|
968
|
-
onError: e => {
|
|
969
|
-
console.error('Photo failed to load:', e);
|
|
970
|
-
// Could replace with placeholder image
|
|
971
|
-
},
|
|
972
|
-
onMouseEnter: e => {
|
|
973
|
-
e.currentTarget.style.transform = 'scale(1.02)';
|
|
974
|
-
},
|
|
975
|
-
onMouseLeave: e => {
|
|
976
|
-
e.currentTarget.style.transform = 'scale(1)';
|
|
977
|
-
}
|
|
978
|
-
}) : /*#__PURE__*/_jsx(Image, {
|
|
979
|
-
source: {
|
|
980
|
-
uri: downloadUrl
|
|
981
|
-
},
|
|
982
|
-
style: styles.photoImage,
|
|
983
|
-
resizeMode: "cover",
|
|
984
|
-
onError: e => {
|
|
985
|
-
console.error('Photo failed to load:', e);
|
|
986
|
-
}
|
|
987
|
-
})
|
|
988
|
-
})
|
|
989
|
-
}, photo.id);
|
|
990
|
-
};
|
|
991
|
-
const renderFileDetailsModal = () => /*#__PURE__*/_jsx(Modal, {
|
|
992
|
-
visible: showFileDetails,
|
|
993
|
-
animationType: "slide",
|
|
994
|
-
presentationStyle: "pageSheet",
|
|
995
|
-
onRequestClose: () => setShowFileDetails(false),
|
|
996
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
997
|
-
style: [styles.modalContainer, {
|
|
998
|
-
backgroundColor
|
|
999
|
-
}],
|
|
1000
|
-
children: [/*#__PURE__*/_jsxs(View, {
|
|
1001
|
-
style: [styles.modalHeader, {
|
|
1002
|
-
borderBottomColor: borderColor
|
|
1003
|
+
const renderFileDetailsModal = () => {
|
|
1004
|
+
const backgroundColor = themeStyles.backgroundColor;
|
|
1005
|
+
const borderColor = themeStyles.borderColor;
|
|
1006
|
+
return /*#__PURE__*/_jsx(Modal, {
|
|
1007
|
+
visible: showFileDetails,
|
|
1008
|
+
animationType: "slide",
|
|
1009
|
+
presentationStyle: "pageSheet",
|
|
1010
|
+
onRequestClose: () => setShowFileDetails(false),
|
|
1011
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
1012
|
+
style: [styles.modalContainer, {
|
|
1013
|
+
backgroundColor
|
|
1003
1014
|
}],
|
|
1004
|
-
children: [/*#__PURE__*/
|
|
1005
|
-
style: styles.
|
|
1006
|
-
|
|
1007
|
-
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1008
|
-
name: "close",
|
|
1009
|
-
size: 24,
|
|
1010
|
-
color: textColor
|
|
1011
|
-
})
|
|
1012
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
1013
|
-
style: [styles.modalTitle, {
|
|
1014
|
-
color: textColor
|
|
1015
|
-
}],
|
|
1016
|
-
children: "File Details"
|
|
1017
|
-
}), /*#__PURE__*/_jsx(View, {
|
|
1018
|
-
style: styles.modalPlaceholder
|
|
1019
|
-
})]
|
|
1020
|
-
}), selectedFile && /*#__PURE__*/_jsx(ScrollView, {
|
|
1021
|
-
style: styles.modalContent,
|
|
1022
|
-
children: /*#__PURE__*/_jsxs(View, {
|
|
1023
|
-
style: [styles.fileDetailCard, {
|
|
1024
|
-
backgroundColor: secondaryBackgroundColor,
|
|
1025
|
-
borderColor
|
|
1015
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
1016
|
+
style: [styles.modalHeader, {
|
|
1017
|
+
borderBottomColor: borderColor
|
|
1026
1018
|
}],
|
|
1027
|
-
children: [/*#__PURE__*/_jsx(
|
|
1028
|
-
style: styles.
|
|
1019
|
+
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1020
|
+
style: styles.modalCloseButton,
|
|
1021
|
+
onPress: () => setShowFileDetails(false),
|
|
1029
1022
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1030
|
-
name:
|
|
1031
|
-
size:
|
|
1032
|
-
color:
|
|
1023
|
+
name: "close",
|
|
1024
|
+
size: 24,
|
|
1025
|
+
color: themeStyles.textColor
|
|
1033
1026
|
})
|
|
1034
1027
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1035
|
-
style: [styles.
|
|
1036
|
-
color: textColor
|
|
1028
|
+
style: [styles.modalTitle, {
|
|
1029
|
+
color: themeStyles.textColor
|
|
1037
1030
|
}],
|
|
1038
|
-
children:
|
|
1039
|
-
}), /*#__PURE__*/
|
|
1040
|
-
style: styles.
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1031
|
+
children: "File Details"
|
|
1032
|
+
}), /*#__PURE__*/_jsx(View, {
|
|
1033
|
+
style: styles.modalPlaceholder
|
|
1034
|
+
})]
|
|
1035
|
+
}), selectedFile && /*#__PURE__*/_jsx(ScrollView, {
|
|
1036
|
+
style: styles.modalContent,
|
|
1037
|
+
children: /*#__PURE__*/_jsxs(View, {
|
|
1038
|
+
style: [styles.fileDetailCard, {
|
|
1039
|
+
backgroundColor: themeStyles.secondaryBackgroundColor,
|
|
1040
|
+
borderColor
|
|
1041
|
+
}],
|
|
1042
|
+
children: [/*#__PURE__*/_jsx(View, {
|
|
1043
|
+
style: styles.fileDetailIcon,
|
|
1044
|
+
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1045
|
+
name: getFileIcon(selectedFile.contentType),
|
|
1046
|
+
size: 64,
|
|
1047
|
+
color: themeStyles.primaryColor
|
|
1048
|
+
})
|
|
1049
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
1050
|
+
style: [styles.fileDetailName, {
|
|
1051
|
+
color: themeStyles.textColor
|
|
1052
|
+
}],
|
|
1053
|
+
children: selectedFile.filename
|
|
1054
1054
|
}), /*#__PURE__*/_jsxs(View, {
|
|
1055
|
-
style: styles.
|
|
1056
|
-
children: [/*#__PURE__*/
|
|
1057
|
-
style:
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1055
|
+
style: styles.fileDetailInfo,
|
|
1056
|
+
children: [/*#__PURE__*/_jsxs(View, {
|
|
1057
|
+
style: styles.detailRow,
|
|
1058
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
1059
|
+
style: [styles.detailLabel, {
|
|
1060
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1061
|
+
}],
|
|
1062
|
+
children: "Size:"
|
|
1063
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
1064
|
+
style: [styles.detailValue, {
|
|
1065
|
+
color: themeStyles.textColor
|
|
1066
|
+
}],
|
|
1067
|
+
children: formatFileSize(selectedFile.length)
|
|
1068
|
+
})]
|
|
1069
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
1070
|
+
style: styles.detailRow,
|
|
1071
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
1072
|
+
style: [styles.detailLabel, {
|
|
1073
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1074
|
+
}],
|
|
1075
|
+
children: "Type:"
|
|
1076
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
1077
|
+
style: [styles.detailValue, {
|
|
1078
|
+
color: themeStyles.textColor
|
|
1079
|
+
}],
|
|
1080
|
+
children: selectedFile.contentType
|
|
1081
|
+
})]
|
|
1082
|
+
}), /*#__PURE__*/_jsxs(View, {
|
|
1083
|
+
style: styles.detailRow,
|
|
1084
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
1085
|
+
style: [styles.detailLabel, {
|
|
1086
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1087
|
+
}],
|
|
1088
|
+
children: "Uploaded:"
|
|
1089
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
1090
|
+
style: [styles.detailValue, {
|
|
1091
|
+
color: themeStyles.textColor
|
|
1092
|
+
}],
|
|
1093
|
+
children: new Date(selectedFile.uploadDate).toLocaleString()
|
|
1094
|
+
})]
|
|
1095
|
+
}), selectedFile.metadata?.description && /*#__PURE__*/_jsxs(View, {
|
|
1096
|
+
style: styles.detailRow,
|
|
1097
|
+
children: [/*#__PURE__*/_jsx(Text, {
|
|
1098
|
+
style: [styles.detailLabel, {
|
|
1099
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1100
|
+
}],
|
|
1101
|
+
children: "Description:"
|
|
1102
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
1103
|
+
style: [styles.detailValue, {
|
|
1104
|
+
color: themeStyles.textColor
|
|
1105
|
+
}],
|
|
1106
|
+
children: selectedFile.metadata.description
|
|
1107
|
+
})]
|
|
1066
1108
|
})]
|
|
1067
1109
|
}), /*#__PURE__*/_jsxs(View, {
|
|
1068
|
-
style: styles.
|
|
1069
|
-
children: [/*#__PURE__*/
|
|
1070
|
-
style: [styles.
|
|
1071
|
-
|
|
1110
|
+
style: styles.modalActions,
|
|
1111
|
+
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
1112
|
+
style: [styles.modalActionButton, {
|
|
1113
|
+
backgroundColor: themeStyles.primaryColor
|
|
1072
1114
|
}],
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1115
|
+
onPress: () => {
|
|
1116
|
+
handleFileDownload(selectedFile.id, selectedFile.filename);
|
|
1117
|
+
setShowFileDetails(false);
|
|
1118
|
+
},
|
|
1119
|
+
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1120
|
+
name: "download",
|
|
1121
|
+
size: 20,
|
|
1122
|
+
color: "#FFFFFF"
|
|
1123
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
1124
|
+
style: styles.modalActionText,
|
|
1125
|
+
children: "Download"
|
|
1126
|
+
})]
|
|
1127
|
+
}), user?.id === targetUserId && /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
1128
|
+
style: [styles.modalActionButton, {
|
|
1129
|
+
backgroundColor: themeStyles.dangerColor
|
|
1077
1130
|
}],
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
}],
|
|
1091
|
-
children: selectedFile.metadata.description
|
|
1131
|
+
onPress: () => {
|
|
1132
|
+
setShowFileDetails(false);
|
|
1133
|
+
handleFileDelete(selectedFile.id, selectedFile.filename);
|
|
1134
|
+
},
|
|
1135
|
+
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1136
|
+
name: "trash",
|
|
1137
|
+
size: 20,
|
|
1138
|
+
color: "#FFFFFF"
|
|
1139
|
+
}), /*#__PURE__*/_jsx(Text, {
|
|
1140
|
+
style: styles.modalActionText,
|
|
1141
|
+
children: "Delete"
|
|
1142
|
+
})]
|
|
1092
1143
|
})]
|
|
1093
1144
|
})]
|
|
1094
|
-
})
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
}],
|
|
1100
|
-
onPress: () => {
|
|
1101
|
-
handleFileDownload(selectedFile.id, selectedFile.filename);
|
|
1102
|
-
setShowFileDetails(false);
|
|
1103
|
-
},
|
|
1104
|
-
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1105
|
-
name: "download",
|
|
1106
|
-
size: 20,
|
|
1107
|
-
color: "#FFFFFF"
|
|
1108
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
1109
|
-
style: styles.modalActionText,
|
|
1110
|
-
children: "Download"
|
|
1111
|
-
})]
|
|
1112
|
-
}), user?.id === targetUserId && /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
1113
|
-
style: [styles.modalActionButton, {
|
|
1114
|
-
backgroundColor: dangerColor
|
|
1115
|
-
}],
|
|
1116
|
-
onPress: () => {
|
|
1117
|
-
setShowFileDetails(false);
|
|
1118
|
-
handleFileDelete(selectedFile.id, selectedFile.filename);
|
|
1119
|
-
},
|
|
1120
|
-
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1121
|
-
name: "trash",
|
|
1122
|
-
size: 20,
|
|
1123
|
-
color: "#FFFFFF"
|
|
1124
|
-
}), /*#__PURE__*/_jsx(Text, {
|
|
1125
|
-
style: styles.modalActionText,
|
|
1126
|
-
children: "Delete"
|
|
1127
|
-
})]
|
|
1128
|
-
})]
|
|
1129
|
-
})]
|
|
1130
|
-
})
|
|
1131
|
-
})]
|
|
1132
|
-
})
|
|
1133
|
-
});
|
|
1145
|
+
})
|
|
1146
|
+
})]
|
|
1147
|
+
})
|
|
1148
|
+
});
|
|
1149
|
+
};
|
|
1134
1150
|
const renderFileViewer = () => {
|
|
1135
1151
|
if (!openedFile) return null;
|
|
1152
|
+
const backgroundColor = themeStyles.backgroundColor;
|
|
1153
|
+
const borderColor = themeStyles.borderColor;
|
|
1136
1154
|
const isImage = openedFile.contentType.startsWith('image/');
|
|
1137
1155
|
const isText = openedFile.contentType.startsWith('text/') || openedFile.contentType.includes('json') || openedFile.contentType.includes('xml') || openedFile.contentType.includes('javascript') || openedFile.contentType.includes('typescript');
|
|
1138
1156
|
const isPDF = openedFile.contentType.includes('pdf');
|
|
@@ -1152,19 +1170,19 @@ const FileManagementScreen = ({
|
|
|
1152
1170
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1153
1171
|
name: "arrow-back",
|
|
1154
1172
|
size: 24,
|
|
1155
|
-
color: textColor
|
|
1173
|
+
color: themeStyles.textColor
|
|
1156
1174
|
})
|
|
1157
1175
|
}), /*#__PURE__*/_jsxs(View, {
|
|
1158
1176
|
style: styles.fileViewerTitleContainer,
|
|
1159
1177
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1160
1178
|
style: [styles.fileViewerTitle, {
|
|
1161
|
-
color: textColor
|
|
1179
|
+
color: themeStyles.textColor
|
|
1162
1180
|
}],
|
|
1163
1181
|
numberOfLines: 1,
|
|
1164
1182
|
children: openedFile.filename
|
|
1165
1183
|
}), /*#__PURE__*/_jsxs(Text, {
|
|
1166
1184
|
style: [styles.fileViewerSubtitle, {
|
|
1167
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1185
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1168
1186
|
}],
|
|
1169
1187
|
children: [formatFileSize(openedFile.length), " \u2022 ", openedFile.contentType]
|
|
1170
1188
|
})]
|
|
@@ -1172,36 +1190,36 @@ const FileManagementScreen = ({
|
|
|
1172
1190
|
style: styles.fileViewerActions,
|
|
1173
1191
|
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1174
1192
|
style: [styles.actionButton, {
|
|
1175
|
-
backgroundColor: isDarkTheme ? '#333333' : '#F0F0F0'
|
|
1193
|
+
backgroundColor: themeStyles.isDarkTheme ? '#333333' : '#F0F0F0'
|
|
1176
1194
|
}],
|
|
1177
1195
|
onPress: () => handleFileDownload(openedFile.id, openedFile.filename),
|
|
1178
1196
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1179
1197
|
name: "download",
|
|
1180
1198
|
size: 20,
|
|
1181
|
-
color: primaryColor
|
|
1199
|
+
color: themeStyles.primaryColor
|
|
1182
1200
|
})
|
|
1183
1201
|
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1184
1202
|
style: [styles.actionButton, {
|
|
1185
|
-
backgroundColor: showFileDetailsInViewer ? primaryColor : isDarkTheme ? '#333333' : '#F0F0F0'
|
|
1203
|
+
backgroundColor: showFileDetailsInViewer ? themeStyles.primaryColor : themeStyles.isDarkTheme ? '#333333' : '#F0F0F0'
|
|
1186
1204
|
}],
|
|
1187
1205
|
onPress: () => setShowFileDetailsInViewer(!showFileDetailsInViewer),
|
|
1188
1206
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1189
1207
|
name: showFileDetailsInViewer ? "chevron-up" : "information-circle",
|
|
1190
1208
|
size: 20,
|
|
1191
|
-
color: showFileDetailsInViewer ? "#FFFFFF" : primaryColor
|
|
1209
|
+
color: showFileDetailsInViewer ? "#FFFFFF" : themeStyles.primaryColor
|
|
1192
1210
|
})
|
|
1193
1211
|
})]
|
|
1194
1212
|
})]
|
|
1195
1213
|
}), showFileDetailsInViewer && /*#__PURE__*/_jsxs(View, {
|
|
1196
1214
|
style: [styles.fileDetailsSection, {
|
|
1197
|
-
backgroundColor: secondaryBackgroundColor,
|
|
1215
|
+
backgroundColor: themeStyles.secondaryBackgroundColor,
|
|
1198
1216
|
borderColor
|
|
1199
1217
|
}],
|
|
1200
1218
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
1201
1219
|
style: styles.fileDetailsSectionHeader,
|
|
1202
1220
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1203
1221
|
style: [styles.fileDetailsSectionTitle, {
|
|
1204
|
-
color: textColor
|
|
1222
|
+
color: themeStyles.textColor
|
|
1205
1223
|
}],
|
|
1206
1224
|
children: "File Details"
|
|
1207
1225
|
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
@@ -1210,7 +1228,7 @@ const FileManagementScreen = ({
|
|
|
1210
1228
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1211
1229
|
name: "chevron-up",
|
|
1212
1230
|
size: 20,
|
|
1213
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1231
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1214
1232
|
})
|
|
1215
1233
|
})]
|
|
1216
1234
|
}), /*#__PURE__*/_jsxs(View, {
|
|
@@ -1219,12 +1237,12 @@ const FileManagementScreen = ({
|
|
|
1219
1237
|
style: styles.detailRow,
|
|
1220
1238
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1221
1239
|
style: [styles.detailLabel, {
|
|
1222
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1240
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1223
1241
|
}],
|
|
1224
1242
|
children: "File Name:"
|
|
1225
1243
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1226
1244
|
style: [styles.detailValue, {
|
|
1227
|
-
color: textColor
|
|
1245
|
+
color: themeStyles.textColor
|
|
1228
1246
|
}],
|
|
1229
1247
|
children: openedFile.filename
|
|
1230
1248
|
})]
|
|
@@ -1232,12 +1250,12 @@ const FileManagementScreen = ({
|
|
|
1232
1250
|
style: styles.detailRow,
|
|
1233
1251
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1234
1252
|
style: [styles.detailLabel, {
|
|
1235
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1253
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1236
1254
|
}],
|
|
1237
1255
|
children: "Size:"
|
|
1238
1256
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1239
1257
|
style: [styles.detailValue, {
|
|
1240
|
-
color: textColor
|
|
1258
|
+
color: themeStyles.textColor
|
|
1241
1259
|
}],
|
|
1242
1260
|
children: formatFileSize(openedFile.length)
|
|
1243
1261
|
})]
|
|
@@ -1245,12 +1263,12 @@ const FileManagementScreen = ({
|
|
|
1245
1263
|
style: styles.detailRow,
|
|
1246
1264
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1247
1265
|
style: [styles.detailLabel, {
|
|
1248
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1266
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1249
1267
|
}],
|
|
1250
1268
|
children: "Type:"
|
|
1251
1269
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1252
1270
|
style: [styles.detailValue, {
|
|
1253
|
-
color: textColor
|
|
1271
|
+
color: themeStyles.textColor
|
|
1254
1272
|
}],
|
|
1255
1273
|
children: openedFile.contentType
|
|
1256
1274
|
})]
|
|
@@ -1258,12 +1276,12 @@ const FileManagementScreen = ({
|
|
|
1258
1276
|
style: styles.detailRow,
|
|
1259
1277
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1260
1278
|
style: [styles.detailLabel, {
|
|
1261
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1279
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1262
1280
|
}],
|
|
1263
1281
|
children: "Uploaded:"
|
|
1264
1282
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1265
1283
|
style: [styles.detailValue, {
|
|
1266
|
-
color: textColor
|
|
1284
|
+
color: themeStyles.textColor
|
|
1267
1285
|
}],
|
|
1268
1286
|
children: new Date(openedFile.uploadDate).toLocaleString()
|
|
1269
1287
|
})]
|
|
@@ -1271,12 +1289,12 @@ const FileManagementScreen = ({
|
|
|
1271
1289
|
style: styles.detailRow,
|
|
1272
1290
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1273
1291
|
style: [styles.detailLabel, {
|
|
1274
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1292
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1275
1293
|
}],
|
|
1276
1294
|
children: "Description:"
|
|
1277
1295
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1278
1296
|
style: [styles.detailValue, {
|
|
1279
|
-
color: textColor
|
|
1297
|
+
color: themeStyles.textColor
|
|
1280
1298
|
}],
|
|
1281
1299
|
children: openedFile.metadata.description
|
|
1282
1300
|
})]
|
|
@@ -1284,12 +1302,12 @@ const FileManagementScreen = ({
|
|
|
1284
1302
|
style: styles.detailRow,
|
|
1285
1303
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1286
1304
|
style: [styles.detailLabel, {
|
|
1287
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1305
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1288
1306
|
}],
|
|
1289
1307
|
children: "File ID:"
|
|
1290
1308
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1291
1309
|
style: [styles.detailValue, {
|
|
1292
|
-
color: textColor,
|
|
1310
|
+
color: themeStyles.textColor,
|
|
1293
1311
|
fontSize: 12,
|
|
1294
1312
|
fontFamily: Platform.OS === 'web' ? 'monospace' : 'Courier'
|
|
1295
1313
|
}],
|
|
@@ -1300,7 +1318,7 @@ const FileManagementScreen = ({
|
|
|
1300
1318
|
style: styles.fileDetailsActions,
|
|
1301
1319
|
children: [/*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
1302
1320
|
style: [styles.fileDetailsActionButton, {
|
|
1303
|
-
backgroundColor: primaryColor
|
|
1321
|
+
backgroundColor: themeStyles.primaryColor
|
|
1304
1322
|
}],
|
|
1305
1323
|
onPress: () => handleFileDownload(openedFile.id, openedFile.filename),
|
|
1306
1324
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
@@ -1313,7 +1331,7 @@ const FileManagementScreen = ({
|
|
|
1313
1331
|
})]
|
|
1314
1332
|
}), user?.id === targetUserId && /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
1315
1333
|
style: [styles.fileDetailsActionButton, {
|
|
1316
|
-
backgroundColor: dangerColor
|
|
1334
|
+
backgroundColor: themeStyles.dangerColor
|
|
1317
1335
|
}],
|
|
1318
1336
|
onPress: () => {
|
|
1319
1337
|
handleCloseFile();
|
|
@@ -1336,10 +1354,10 @@ const FileManagementScreen = ({
|
|
|
1336
1354
|
style: styles.fileViewerLoading,
|
|
1337
1355
|
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
1338
1356
|
size: "large",
|
|
1339
|
-
color: primaryColor
|
|
1357
|
+
color: themeStyles.primaryColor
|
|
1340
1358
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1341
1359
|
style: [styles.fileViewerLoadingText, {
|
|
1342
|
-
color: textColor
|
|
1360
|
+
color: themeStyles.textColor
|
|
1343
1361
|
}],
|
|
1344
1362
|
children: "Loading file content..."
|
|
1345
1363
|
})]
|
|
@@ -1373,7 +1391,7 @@ const FileManagementScreen = ({
|
|
|
1373
1391
|
})
|
|
1374
1392
|
}) : isText && fileContent ? /*#__PURE__*/_jsx(View, {
|
|
1375
1393
|
style: [styles.textContainer, {
|
|
1376
|
-
backgroundColor: secondaryBackgroundColor,
|
|
1394
|
+
backgroundColor: themeStyles.secondaryBackgroundColor,
|
|
1377
1395
|
borderColor
|
|
1378
1396
|
}],
|
|
1379
1397
|
children: /*#__PURE__*/_jsx(ScrollView, {
|
|
@@ -1383,7 +1401,7 @@ const FileManagementScreen = ({
|
|
|
1383
1401
|
nestedScrollEnabled: true,
|
|
1384
1402
|
children: /*#__PURE__*/_jsx(Text, {
|
|
1385
1403
|
style: [styles.textContent, {
|
|
1386
|
-
color: textColor
|
|
1404
|
+
color: themeStyles.textColor
|
|
1387
1405
|
}],
|
|
1388
1406
|
children: fileContent
|
|
1389
1407
|
})
|
|
@@ -1415,7 +1433,7 @@ const FileManagementScreen = ({
|
|
|
1415
1433
|
}), "Your browser does not support the video tag."]
|
|
1416
1434
|
}) : /*#__PURE__*/_jsx(Text, {
|
|
1417
1435
|
style: [styles.unsupportedText, {
|
|
1418
|
-
color: textColor
|
|
1436
|
+
color: themeStyles.textColor
|
|
1419
1437
|
}],
|
|
1420
1438
|
children: "Video playback not supported on mobile"
|
|
1421
1439
|
})
|
|
@@ -1433,7 +1451,7 @@ const FileManagementScreen = ({
|
|
|
1433
1451
|
}), "Your browser does not support the audio tag."]
|
|
1434
1452
|
}) : /*#__PURE__*/_jsx(Text, {
|
|
1435
1453
|
style: [styles.unsupportedText, {
|
|
1436
|
-
color: textColor
|
|
1454
|
+
color: themeStyles.textColor
|
|
1437
1455
|
}],
|
|
1438
1456
|
children: "Audio playback not supported on mobile"
|
|
1439
1457
|
})
|
|
@@ -1442,20 +1460,20 @@ const FileManagementScreen = ({
|
|
|
1442
1460
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1443
1461
|
name: getFileIcon(openedFile.contentType),
|
|
1444
1462
|
size: 64,
|
|
1445
|
-
color: isDarkTheme ? '#666666' : '#CCCCCC'
|
|
1463
|
+
color: themeStyles.isDarkTheme ? '#666666' : '#CCCCCC'
|
|
1446
1464
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1447
1465
|
style: [styles.unsupportedFileTitle, {
|
|
1448
|
-
color: textColor
|
|
1466
|
+
color: themeStyles.textColor
|
|
1449
1467
|
}],
|
|
1450
1468
|
children: "Preview Not Available"
|
|
1451
1469
|
}), /*#__PURE__*/_jsxs(Text, {
|
|
1452
1470
|
style: [styles.unsupportedFileDescription, {
|
|
1453
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1471
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1454
1472
|
}],
|
|
1455
1473
|
children: ["This file type cannot be previewed in the browser.", '\n', "Download the file to view its contents."]
|
|
1456
1474
|
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
1457
1475
|
style: [styles.downloadButtonLarge, {
|
|
1458
|
-
backgroundColor: primaryColor
|
|
1476
|
+
backgroundColor: themeStyles.primaryColor
|
|
1459
1477
|
}],
|
|
1460
1478
|
onPress: () => handleFileDownload(openedFile.id, openedFile.filename),
|
|
1461
1479
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
@@ -1476,20 +1494,20 @@ const FileManagementScreen = ({
|
|
|
1476
1494
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1477
1495
|
name: "folder-open-outline",
|
|
1478
1496
|
size: 64,
|
|
1479
|
-
color: isDarkTheme ? '#666666' : '#CCCCCC'
|
|
1497
|
+
color: themeStyles.isDarkTheme ? '#666666' : '#CCCCCC'
|
|
1480
1498
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1481
1499
|
style: [styles.emptyStateTitle, {
|
|
1482
|
-
color: textColor
|
|
1500
|
+
color: themeStyles.textColor
|
|
1483
1501
|
}],
|
|
1484
1502
|
children: "No Files Yet"
|
|
1485
1503
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1486
1504
|
style: [styles.emptyStateDescription, {
|
|
1487
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1505
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1488
1506
|
}],
|
|
1489
1507
|
children: user?.id === targetUserId ? `Upload files to get started. You can select multiple files at once${Platform.OS === 'web' ? ' or drag & drop them here.' : '.'}` : "This user hasn't uploaded any files yet"
|
|
1490
1508
|
}), user?.id === targetUserId && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1491
1509
|
style: [styles.emptyStateButton, {
|
|
1492
|
-
backgroundColor: primaryColor
|
|
1510
|
+
backgroundColor: themeStyles.primaryColor
|
|
1493
1511
|
}],
|
|
1494
1512
|
onPress: handleFileUpload,
|
|
1495
1513
|
disabled: uploading,
|
|
@@ -1515,10 +1533,10 @@ const FileManagementScreen = ({
|
|
|
1515
1533
|
}],
|
|
1516
1534
|
children: [/*#__PURE__*/_jsx(ActivityIndicator, {
|
|
1517
1535
|
size: "large",
|
|
1518
|
-
color: primaryColor
|
|
1536
|
+
color: themeStyles.primaryColor
|
|
1519
1537
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1520
1538
|
style: [styles.loadingText, {
|
|
1521
|
-
color: textColor
|
|
1539
|
+
color: themeStyles.textColor
|
|
1522
1540
|
}],
|
|
1523
1541
|
children: "Loading files..."
|
|
1524
1542
|
})]
|
|
@@ -1543,37 +1561,37 @@ const FileManagementScreen = ({
|
|
|
1543
1561
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
1544
1562
|
style: [styles.header, {
|
|
1545
1563
|
borderBottomColor: borderColor,
|
|
1546
|
-
backgroundColor: isDarkTheme ? '#1A1A1A' : '#FFFFFF',
|
|
1564
|
+
backgroundColor: themeStyles.isDarkTheme ? '#1A1A1A' : '#FFFFFF',
|
|
1547
1565
|
shadowColor: '#000000',
|
|
1548
1566
|
shadowOffset: {
|
|
1549
1567
|
width: 0,
|
|
1550
1568
|
height: 2
|
|
1551
1569
|
},
|
|
1552
|
-
shadowOpacity: isDarkTheme ? 0.3 : 0.1,
|
|
1570
|
+
shadowOpacity: themeStyles.isDarkTheme ? 0.3 : 0.1,
|
|
1553
1571
|
shadowRadius: 8,
|
|
1554
1572
|
elevation: 4
|
|
1555
1573
|
}],
|
|
1556
1574
|
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1557
1575
|
style: [styles.backButton, {
|
|
1558
|
-
backgroundColor: isDarkTheme ? '#2A2A2A' : '#F8F9FA',
|
|
1576
|
+
backgroundColor: themeStyles.isDarkTheme ? '#2A2A2A' : '#F8F9FA',
|
|
1559
1577
|
borderRadius: 12
|
|
1560
1578
|
}],
|
|
1561
1579
|
onPress: onClose || goBack,
|
|
1562
1580
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1563
1581
|
name: "arrow-back",
|
|
1564
1582
|
size: 22,
|
|
1565
|
-
color: textColor
|
|
1583
|
+
color: themeStyles.textColor
|
|
1566
1584
|
})
|
|
1567
1585
|
}), /*#__PURE__*/_jsxs(View, {
|
|
1568
1586
|
style: styles.headerTitleContainer,
|
|
1569
1587
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1570
1588
|
style: [styles.headerTitle, {
|
|
1571
|
-
color: textColor
|
|
1589
|
+
color: themeStyles.textColor
|
|
1572
1590
|
}],
|
|
1573
1591
|
children: viewMode === 'photos' ? 'Photos' : 'File Management'
|
|
1574
1592
|
}), /*#__PURE__*/_jsxs(Text, {
|
|
1575
1593
|
style: [styles.headerSubtitle, {
|
|
1576
|
-
color: isDarkTheme ? '#AAAAAA' : '#666666'
|
|
1594
|
+
color: themeStyles.isDarkTheme ? '#AAAAAA' : '#666666'
|
|
1577
1595
|
}],
|
|
1578
1596
|
children: [filteredFiles.length, " ", filteredFiles.length === 1 ? 'item' : 'items']
|
|
1579
1597
|
})]
|
|
@@ -1581,22 +1599,22 @@ const FileManagementScreen = ({
|
|
|
1581
1599
|
style: styles.headerActions,
|
|
1582
1600
|
children: [/*#__PURE__*/_jsxs(View, {
|
|
1583
1601
|
style: [styles.viewModeToggle, {
|
|
1584
|
-
backgroundColor: isDarkTheme ? '#2A2A2A' : '#F8F9FA',
|
|
1602
|
+
backgroundColor: themeStyles.isDarkTheme ? '#2A2A2A' : '#F8F9FA',
|
|
1585
1603
|
borderWidth: 1,
|
|
1586
|
-
borderColor: isDarkTheme ? '#3A3A3A' : '#E8E9EA',
|
|
1604
|
+
borderColor: themeStyles.isDarkTheme ? '#3A3A3A' : '#E8E9EA',
|
|
1587
1605
|
shadowColor: '#000000',
|
|
1588
1606
|
shadowOffset: {
|
|
1589
1607
|
width: 0,
|
|
1590
1608
|
height: 1
|
|
1591
1609
|
},
|
|
1592
|
-
shadowOpacity: isDarkTheme ? 0.3 : 0.05,
|
|
1610
|
+
shadowOpacity: themeStyles.isDarkTheme ? 0.3 : 0.05,
|
|
1593
1611
|
shadowRadius: 4,
|
|
1594
1612
|
elevation: 2
|
|
1595
1613
|
}],
|
|
1596
1614
|
children: [/*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1597
1615
|
style: [styles.viewModeButton, viewMode === 'all' && {
|
|
1598
|
-
backgroundColor: primaryColor,
|
|
1599
|
-
shadowColor: primaryColor,
|
|
1616
|
+
backgroundColor: themeStyles.primaryColor,
|
|
1617
|
+
shadowColor: themeStyles.primaryColor,
|
|
1600
1618
|
shadowOffset: {
|
|
1601
1619
|
width: 0,
|
|
1602
1620
|
height: 2
|
|
@@ -1609,12 +1627,12 @@ const FileManagementScreen = ({
|
|
|
1609
1627
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1610
1628
|
name: "folder",
|
|
1611
1629
|
size: 18,
|
|
1612
|
-
color: viewMode === 'all' ? '#FFFFFF' : textColor
|
|
1630
|
+
color: viewMode === 'all' ? '#FFFFFF' : themeStyles.textColor
|
|
1613
1631
|
})
|
|
1614
1632
|
}), /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1615
1633
|
style: [styles.viewModeButton, viewMode === 'photos' && {
|
|
1616
|
-
backgroundColor: primaryColor,
|
|
1617
|
-
shadowColor: primaryColor,
|
|
1634
|
+
backgroundColor: themeStyles.primaryColor,
|
|
1635
|
+
shadowColor: themeStyles.primaryColor,
|
|
1618
1636
|
shadowOffset: {
|
|
1619
1637
|
width: 0,
|
|
1620
1638
|
height: 2
|
|
@@ -1627,13 +1645,13 @@ const FileManagementScreen = ({
|
|
|
1627
1645
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1628
1646
|
name: "images",
|
|
1629
1647
|
size: 18,
|
|
1630
|
-
color: viewMode === 'photos' ? '#FFFFFF' : textColor
|
|
1648
|
+
color: viewMode === 'photos' ? '#FFFFFF' : themeStyles.textColor
|
|
1631
1649
|
})
|
|
1632
1650
|
})]
|
|
1633
1651
|
}), user?.id === targetUserId && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
1634
1652
|
style: [styles.uploadButton, {
|
|
1635
|
-
backgroundColor: primaryColor,
|
|
1636
|
-
shadowColor: primaryColor,
|
|
1653
|
+
backgroundColor: themeStyles.primaryColor,
|
|
1654
|
+
shadowColor: themeStyles.primaryColor,
|
|
1637
1655
|
shadowOffset: {
|
|
1638
1656
|
width: 0,
|
|
1639
1657
|
height: 3
|
|
@@ -1667,27 +1685,27 @@ const FileManagementScreen = ({
|
|
|
1667
1685
|
})]
|
|
1668
1686
|
}), files.length > 0 && (viewMode === 'all' || files.some(f => f.contentType.startsWith('image/'))) && /*#__PURE__*/_jsxs(View, {
|
|
1669
1687
|
style: [styles.searchContainer, {
|
|
1670
|
-
backgroundColor: isDarkTheme ? '#1A1A1A' : '#FFFFFF',
|
|
1671
|
-
borderColor: isDarkTheme ? '#3A3A3A' : '#E8E9EA',
|
|
1688
|
+
backgroundColor: themeStyles.isDarkTheme ? '#1A1A1A' : '#FFFFFF',
|
|
1689
|
+
borderColor: themeStyles.isDarkTheme ? '#3A3A3A' : '#E8E9EA',
|
|
1672
1690
|
shadowColor: '#000000',
|
|
1673
1691
|
shadowOffset: {
|
|
1674
1692
|
width: 0,
|
|
1675
1693
|
height: 1
|
|
1676
1694
|
},
|
|
1677
|
-
shadowOpacity: isDarkTheme ? 0.2 : 0.05,
|
|
1695
|
+
shadowOpacity: themeStyles.isDarkTheme ? 0.2 : 0.05,
|
|
1678
1696
|
shadowRadius: 4,
|
|
1679
1697
|
elevation: 2
|
|
1680
1698
|
}],
|
|
1681
1699
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1682
1700
|
name: "search",
|
|
1683
1701
|
size: 22,
|
|
1684
|
-
color: isDarkTheme ? '#888888' : '#666666'
|
|
1702
|
+
color: themeStyles.isDarkTheme ? '#888888' : '#666666'
|
|
1685
1703
|
}), /*#__PURE__*/_jsx(TextInput, {
|
|
1686
1704
|
style: [styles.searchInput, {
|
|
1687
|
-
color: textColor
|
|
1705
|
+
color: themeStyles.textColor
|
|
1688
1706
|
}],
|
|
1689
1707
|
placeholder: viewMode === 'photos' ? 'Search photos...' : 'Search files...',
|
|
1690
|
-
placeholderTextColor: isDarkTheme ? '#888888' : '#999999',
|
|
1708
|
+
placeholderTextColor: themeStyles.isDarkTheme ? '#888888' : '#999999',
|
|
1691
1709
|
value: searchQuery,
|
|
1692
1710
|
onChangeText: setSearchQuery
|
|
1693
1711
|
}), searchQuery.length > 0 && /*#__PURE__*/_jsx(TouchableOpacity, {
|
|
@@ -1696,19 +1714,19 @@ const FileManagementScreen = ({
|
|
|
1696
1714
|
children: /*#__PURE__*/_jsx(Ionicons, {
|
|
1697
1715
|
name: "close-circle",
|
|
1698
1716
|
size: 22,
|
|
1699
|
-
color: isDarkTheme ? '#888888' : '#666666'
|
|
1717
|
+
color: themeStyles.isDarkTheme ? '#888888' : '#666666'
|
|
1700
1718
|
})
|
|
1701
1719
|
})]
|
|
1702
1720
|
}), files.length > 0 && /*#__PURE__*/_jsxs(View, {
|
|
1703
1721
|
style: [styles.statsContainer, {
|
|
1704
|
-
backgroundColor: isDarkTheme ? '#1A1A1A' : '#FFFFFF',
|
|
1705
|
-
borderColor: isDarkTheme ? '#3A3A3A' : '#E8E9EA',
|
|
1722
|
+
backgroundColor: themeStyles.isDarkTheme ? '#1A1A1A' : '#FFFFFF',
|
|
1723
|
+
borderColor: themeStyles.isDarkTheme ? '#3A3A3A' : '#E8E9EA',
|
|
1706
1724
|
shadowColor: '#000000',
|
|
1707
1725
|
shadowOffset: {
|
|
1708
1726
|
width: 0,
|
|
1709
1727
|
height: 1
|
|
1710
1728
|
},
|
|
1711
|
-
shadowOpacity: isDarkTheme ? 0.2 : 0.05,
|
|
1729
|
+
shadowOpacity: themeStyles.isDarkTheme ? 0.2 : 0.05,
|
|
1712
1730
|
shadowRadius: 4,
|
|
1713
1731
|
elevation: 2
|
|
1714
1732
|
}],
|
|
@@ -1716,12 +1734,12 @@ const FileManagementScreen = ({
|
|
|
1716
1734
|
style: styles.statItem,
|
|
1717
1735
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1718
1736
|
style: [styles.statValue, {
|
|
1719
|
-
color: textColor
|
|
1737
|
+
color: themeStyles.textColor
|
|
1720
1738
|
}],
|
|
1721
1739
|
children: filteredFiles.length
|
|
1722
1740
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1723
1741
|
style: [styles.statLabel, {
|
|
1724
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1742
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1725
1743
|
}],
|
|
1726
1744
|
children: searchQuery.length > 0 ? 'Found' : filteredFiles.length === 1 ? viewMode === 'photos' ? 'Photo' : 'File' : viewMode === 'photos' ? 'Photos' : 'Files'
|
|
1727
1745
|
})]
|
|
@@ -1729,12 +1747,12 @@ const FileManagementScreen = ({
|
|
|
1729
1747
|
style: styles.statItem,
|
|
1730
1748
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1731
1749
|
style: [styles.statValue, {
|
|
1732
|
-
color: textColor
|
|
1750
|
+
color: themeStyles.textColor
|
|
1733
1751
|
}],
|
|
1734
1752
|
children: formatFileSize(filteredFiles.reduce((total, file) => total + file.length, 0))
|
|
1735
1753
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1736
1754
|
style: [styles.statLabel, {
|
|
1737
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1755
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1738
1756
|
}],
|
|
1739
1757
|
children: searchQuery.length > 0 ? 'Size' : 'Total Size'
|
|
1740
1758
|
})]
|
|
@@ -1742,12 +1760,12 @@ const FileManagementScreen = ({
|
|
|
1742
1760
|
style: styles.statItem,
|
|
1743
1761
|
children: [/*#__PURE__*/_jsx(Text, {
|
|
1744
1762
|
style: [styles.statValue, {
|
|
1745
|
-
color: textColor
|
|
1763
|
+
color: themeStyles.textColor
|
|
1746
1764
|
}],
|
|
1747
1765
|
children: files.length
|
|
1748
1766
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1749
1767
|
style: [styles.statLabel, {
|
|
1750
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1768
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1751
1769
|
}],
|
|
1752
1770
|
children: "Total"
|
|
1753
1771
|
})]
|
|
@@ -1758,27 +1776,27 @@ const FileManagementScreen = ({
|
|
|
1758
1776
|
refreshControl: /*#__PURE__*/_jsx(RefreshControl, {
|
|
1759
1777
|
refreshing: refreshing,
|
|
1760
1778
|
onRefresh: () => loadFiles(true),
|
|
1761
|
-
tintColor: primaryColor
|
|
1779
|
+
tintColor: themeStyles.primaryColor
|
|
1762
1780
|
}),
|
|
1763
1781
|
children: filteredFiles.length === 0 && searchQuery.length > 0 ? /*#__PURE__*/_jsxs(View, {
|
|
1764
1782
|
style: styles.emptyState,
|
|
1765
1783
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1766
1784
|
name: "search",
|
|
1767
1785
|
size: 64,
|
|
1768
|
-
color: isDarkTheme ? '#666666' : '#CCCCCC'
|
|
1786
|
+
color: themeStyles.isDarkTheme ? '#666666' : '#CCCCCC'
|
|
1769
1787
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1770
1788
|
style: [styles.emptyStateTitle, {
|
|
1771
|
-
color: textColor
|
|
1789
|
+
color: themeStyles.textColor
|
|
1772
1790
|
}],
|
|
1773
1791
|
children: "No Results Found"
|
|
1774
1792
|
}), /*#__PURE__*/_jsxs(Text, {
|
|
1775
1793
|
style: [styles.emptyStateDescription, {
|
|
1776
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1794
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1777
1795
|
}],
|
|
1778
1796
|
children: ["No files match your search for \"", searchQuery, "\""]
|
|
1779
1797
|
}), /*#__PURE__*/_jsxs(TouchableOpacity, {
|
|
1780
1798
|
style: [styles.emptyStateButton, {
|
|
1781
|
-
backgroundColor: primaryColor
|
|
1799
|
+
backgroundColor: themeStyles.primaryColor
|
|
1782
1800
|
}],
|
|
1783
1801
|
onPress: () => setSearchQuery(''),
|
|
1784
1802
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
@@ -1800,15 +1818,15 @@ const FileManagementScreen = ({
|
|
|
1800
1818
|
children: [/*#__PURE__*/_jsx(Ionicons, {
|
|
1801
1819
|
name: "cloud-upload",
|
|
1802
1820
|
size: 64,
|
|
1803
|
-
color: primaryColor
|
|
1821
|
+
color: themeStyles.primaryColor
|
|
1804
1822
|
}), /*#__PURE__*/_jsx(Text, {
|
|
1805
1823
|
style: [styles.dragDropTitle, {
|
|
1806
|
-
color: primaryColor
|
|
1824
|
+
color: themeStyles.primaryColor
|
|
1807
1825
|
}],
|
|
1808
1826
|
children: "Drop files to upload"
|
|
1809
1827
|
}), /*#__PURE__*/_jsxs(Text, {
|
|
1810
1828
|
style: [styles.dragDropSubtitle, {
|
|
1811
|
-
color: isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1829
|
+
color: themeStyles.isDarkTheme ? '#BBBBBB' : '#666666'
|
|
1812
1830
|
}],
|
|
1813
1831
|
children: ["Release to upload", uploadProgress ? ` (${uploadProgress.current}/${uploadProgress.total})` : ' multiple files']
|
|
1814
1832
|
})]
|