Spaces:
Sleeping
Sleeping
Upload 61 files
Browse files- App.tsx +29 -45
- components/Card.tsx +1 -1
App.tsx
CHANGED
|
@@ -845,8 +845,7 @@ const App: React.FC = () => {
|
|
| 845 |
|
| 846 |
{/* Main Content */}
|
| 847 |
<main className="w-full max-w-[95%] 2xl:max-w-[1800px] mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
| 848 |
-
|
| 849 |
-
{loading ? (
|
| 850 |
<div className="flex flex-col items-center justify-center py-20">
|
| 851 |
<Loader2 className="animate-spin text-primary mb-4" size={40} />
|
| 852 |
<p className="text-gray-500">Sincronizando con CodeByDante Cloud...</p>
|
|
@@ -855,25 +854,23 @@ const App: React.FC = () => {
|
|
| 855 |
<>
|
| 856 |
{view === 'LIST' && (
|
| 857 |
<>
|
| 858 |
-
{/*
|
| 859 |
-
|
| 860 |
-
|
| 861 |
<div className="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 -mt-3 sm:-mt-4">
|
| 862 |
-
|
| 863 |
-
|
| 864 |
-
|
| 865 |
-
|
| 866 |
-
|
| 867 |
-
|
| 868 |
-
|
| 869 |
-
|
| 870 |
-
|
| 871 |
-
|
| 872 |
-
|
| 873 |
-
>
|
| 874 |
-
|
| 875 |
-
</button>
|
| 876 |
-
)}
|
| 877 |
|
| 878 |
{isShowBreadcrumbsEnabled && (
|
| 879 |
<div className="flex items-center gap-1 text-sm text-gray-400 overflow-x-auto pb-1 sm:pb-0 custom-scrollbar w-max max-w-full">
|
|
@@ -882,7 +879,7 @@ const App: React.FC = () => {
|
|
| 882 |
setCurrentFolderId(null);
|
| 883 |
setCurrentPage(1);
|
| 884 |
}}
|
| 885 |
-
className=
|
| 886 |
>
|
| 887 |
Raíz
|
| 888 |
</button>
|
|
@@ -903,24 +900,20 @@ const App: React.FC = () => {
|
|
| 903 |
</div>
|
| 904 |
)}
|
| 905 |
</div>
|
| 906 |
-
|
| 907 |
-
|
| 908 |
-
</>
|
| 909 |
-
)}
|
| 910 |
|
| 911 |
-
|
| 912 |
-
|
| 913 |
-
|
| 914 |
-
|
| 915 |
-
|
| 916 |
<h3 className="text-xl font-medium">No se encontraron elementos</h3>
|
| 917 |
<p className="text-gray-500 mt-2">El repositorio está vacío o no hay coincidencias.</p>
|
| 918 |
</div>
|
| 919 |
) : (
|
| 920 |
<>
|
| 921 |
-
<div
|
| 922 |
-
className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3 items-start"
|
| 923 |
-
>
|
| 924 |
{paginatedItems.map(item => (
|
| 925 |
<Card
|
| 926 |
key={item.id}
|
|
@@ -932,16 +925,8 @@ const App: React.FC = () => {
|
|
| 932 |
setCurrentPage(1);
|
| 933 |
return;
|
| 934 |
}
|
| 935 |
-
setSelectedItem(i);
|
| 936 |
-
|
| 937 |
-
onDoubleClick={(i) => {
|
| 938 |
-
if (i.isFolder) {
|
| 939 |
-
setCurrentFolderId(i.id);
|
| 940 |
-
setCurrentPage(1);
|
| 941 |
-
} else {
|
| 942 |
-
setSelectedItem(i);
|
| 943 |
-
setView('DETAIL');
|
| 944 |
-
}
|
| 945 |
}}
|
| 946 |
isSelectable={viewMode === 'admin' && (isCategoriesPlusEnabled || isDeletePlusEnabled || isFoldersPlusEnabled || isDuplicatePlusEnabled || isPinPlusEnabled)}
|
| 947 |
isSelected={selectedItemIds.has(item.id)}
|
|
@@ -998,7 +983,7 @@ const App: React.FC = () => {
|
|
| 998 |
initialData={selectedItem}
|
| 999 |
onSave={(data) => {
|
| 1000 |
handleUpdate(data);
|
| 1001 |
-
setView('DETAIL');
|
| 1002 |
}}
|
| 1003 |
onCancel={() => setView('DETAIL')}
|
| 1004 |
/>
|
|
@@ -1023,7 +1008,6 @@ const App: React.FC = () => {
|
|
| 1023 |
)}
|
| 1024 |
</>
|
| 1025 |
)}
|
| 1026 |
-
|
| 1027 |
</main>
|
| 1028 |
|
| 1029 |
{/* Floating Action Bar for Bulk Mode */}
|
|
|
|
| 845 |
|
| 846 |
{/* Main Content */}
|
| 847 |
<main className="w-full max-w-[95%] 2xl:max-w-[1800px] mx-auto px-4 sm:px-6 lg:px-8 py-8">
|
| 848 |
+
{loading ? (
|
|
|
|
| 849 |
<div className="flex flex-col items-center justify-center py-20">
|
| 850 |
<Loader2 className="animate-spin text-primary mb-4" size={40} />
|
| 851 |
<p className="text-gray-500">Sincronizando con CodeByDante Cloud...</p>
|
|
|
|
| 854 |
<>
|
| 855 |
{view === 'LIST' && (
|
| 856 |
<>
|
| 857 |
+
{/* Navegación (Solo visible dentro de carpetas para mantener limpia la raíz) */}
|
| 858 |
+
{currentFolderId !== null && (
|
| 859 |
+
<div className="mb-5">
|
| 860 |
<div className="flex flex-col sm:flex-row sm:items-center gap-3 sm:gap-4 -mt-3 sm:-mt-4">
|
| 861 |
+
<button
|
| 862 |
+
onClick={() => {
|
| 863 |
+
if (breadcrumbs.length > 1) {
|
| 864 |
+
setCurrentFolderId(breadcrumbs[breadcrumbs.length - 2].id);
|
| 865 |
+
} else {
|
| 866 |
+
setCurrentFolderId(null);
|
| 867 |
+
}
|
| 868 |
+
setCurrentPage(1);
|
| 869 |
+
}}
|
| 870 |
+
className="flex items-center justify-center sm:justify-start gap-2 px-3 py-1.5 rounded-lg bg-surface hover:bg-white/10 text-gray-300 hover:text-white transition-all text-sm font-medium border border-white/5 w-fit shadow-sm shrink-0"
|
| 871 |
+
>
|
| 872 |
+
<ChevronLeft size={16} /> Volver
|
| 873 |
+
</button>
|
|
|
|
|
|
|
| 874 |
|
| 875 |
{isShowBreadcrumbsEnabled && (
|
| 876 |
<div className="flex items-center gap-1 text-sm text-gray-400 overflow-x-auto pb-1 sm:pb-0 custom-scrollbar w-max max-w-full">
|
|
|
|
| 879 |
setCurrentFolderId(null);
|
| 880 |
setCurrentPage(1);
|
| 881 |
}}
|
| 882 |
+
className="hover:text-white transition-colors px-2 py-1 rounded-md hover:bg-white/5"
|
| 883 |
>
|
| 884 |
Raíz
|
| 885 |
</button>
|
|
|
|
| 900 |
</div>
|
| 901 |
)}
|
| 902 |
</div>
|
| 903 |
+
</div>
|
| 904 |
+
)}
|
|
|
|
|
|
|
| 905 |
|
| 906 |
+
{filteredItems.length === 0 ? (
|
| 907 |
+
<div className="text-center py-20 opacity-50">
|
| 908 |
+
<div className="inline-block p-6 rounded-full bg-surface mb-4">
|
| 909 |
+
<Search size={48} className="text-gray-600" />
|
| 910 |
+
</div>
|
| 911 |
<h3 className="text-xl font-medium">No se encontraron elementos</h3>
|
| 912 |
<p className="text-gray-500 mt-2">El repositorio está vacío o no hay coincidencias.</p>
|
| 913 |
</div>
|
| 914 |
) : (
|
| 915 |
<>
|
| 916 |
+
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-3 items-start">
|
|
|
|
|
|
|
| 917 |
{paginatedItems.map(item => (
|
| 918 |
<Card
|
| 919 |
key={item.id}
|
|
|
|
| 925 |
setCurrentPage(1);
|
| 926 |
return;
|
| 927 |
}
|
| 928 |
+
setSelectedItem(i);
|
| 929 |
+
setView('DETAIL');
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 930 |
}}
|
| 931 |
isSelectable={viewMode === 'admin' && (isCategoriesPlusEnabled || isDeletePlusEnabled || isFoldersPlusEnabled || isDuplicatePlusEnabled || isPinPlusEnabled)}
|
| 932 |
isSelected={selectedItemIds.has(item.id)}
|
|
|
|
| 983 |
initialData={selectedItem}
|
| 984 |
onSave={(data) => {
|
| 985 |
handleUpdate(data);
|
| 986 |
+
setView('DETAIL');
|
| 987 |
}}
|
| 988 |
onCancel={() => setView('DETAIL')}
|
| 989 |
/>
|
|
|
|
| 1008 |
)}
|
| 1009 |
</>
|
| 1010 |
)}
|
|
|
|
| 1011 |
</main>
|
| 1012 |
|
| 1013 |
{/* Floating Action Bar for Bulk Mode */}
|
components/Card.tsx
CHANGED
|
@@ -114,7 +114,7 @@ export const Card: React.FC<CardProps> = ({ item, onClick, isSelectable, isSelec
|
|
| 114 |
dangerouslySetInnerHTML={{ __html: item.summary }}
|
| 115 |
style={{
|
| 116 |
display: '-webkit-box',
|
| 117 |
-
WebkitLineClamp: 3,
|
| 118 |
WebkitBoxOrient: 'vertical',
|
| 119 |
overflow: 'hidden',
|
| 120 |
fontSize: styleConfig.general.cardFontSize
|
|
|
|
| 114 |
dangerouslySetInnerHTML={{ __html: item.summary }}
|
| 115 |
style={{
|
| 116 |
display: '-webkit-box',
|
| 117 |
+
WebkitLineClamp: (item.visitUrl || item.downloadUrl) ? 3 : 6,
|
| 118 |
WebkitBoxOrient: 'vertical',
|
| 119 |
overflow: 'hidden',
|
| 120 |
fontSize: styleConfig.general.cardFontSize
|