diff --git a/frontend/src/App.jsx b/frontend/src/App.jsx index 5a0c1df..df7f325 100644 --- a/frontend/src/App.jsx +++ b/frontend/src/App.jsx @@ -523,27 +523,69 @@ function FolderModal({ folder, onClose }) { } function QuickLinks({ toast, mobile }) { - const [links, setLinks] = useState([]); + const [links, setLinks] = useState([]); const [folderModal, setFolderModal] = useState(null); + const [editMode, setEditMode] = useState(false); useEffect(() => { api('/dashboard/links').then(setLinks).catch(() => {}); }, []); - // Links die kein Ordner sind - const regularLinks = links.filter(l => l.item_type !== 'folder'); - // Ordner-Items - const folderItems = links.filter(l => l.item_type === 'folder'); - // Alles zusammen für Carousel/Grid + const legacyItems = links.filter(l => l.item_type === 'quicklink' || !l.item_type); + const hasLegacy = legacyItems.length > 0; + + const deleteLegacy = async id => { + try { + await api(`/dashboard/links/${id}`, { method:'DELETE' }); + setLinks(p => p.filter(l => l.id !== id)); + toast('Entfernt'); + } catch(e) { toast(e.message,'error'); } + }; + const allItems = links.map(l => l.item_type === 'folder' - ? { ...l, id: `folder-${l.id}`, isFolder: true, icon: l.icon||'📁', title: l.name } + ? { ...l, id:`folder-${l.id}`, isFolder:true, icon:l.icon||'📁', title:l.name } : l ); return (
{folderModal && setFolderModal(null)}/>} -
+
SCHNELLZUGRIFF
+ {hasLegacy && ( + + )}
+ + {/* Edit-Modus: alte Quick-Links verwalten */} + {editMode && hasLegacy && ( +
+
+ ÄLTERE LINKS (aus Einstellungen) — können hier gelöscht werden +
+ {legacyItems.map(l=>( +
+ {l.icon?.startsWith('http') + ? + : l.icon||'🔗'} +
+
{l.title}
+
+ +
+ ))} +
+ Neue Links über Linkliste → ● Schnellzugriff verwalten +
+
+ )} + {allItems.length === 0 ?
Links oder Ordner in der Linkliste mit ● Schnellzugriff aktivieren. diff --git a/frontend/src/tools/linkliste.jsx b/frontend/src/tools/linkliste.jsx index 5398609..ccf5bfb 100644 --- a/frontend/src/tools/linkliste.jsx +++ b/frontend/src/tools/linkliste.jsx @@ -332,9 +332,12 @@ export default function Linkliste({ toast, mobile }) { {!sortMode && (
{!isShared && !isByMe && ( - )} @@ -388,9 +391,12 @@ export default function Linkliste({ toast, mobile }) { )} {!sortMode && (
- @@ -436,8 +442,11 @@ export default function Linkliste({ toast, mobile }) { borderRadius:8,color:'rgba(255,255,255,0.4)',cursor:'pointer',padding:'6px 10px',fontSize:14,fontFamily:'monospace'}}>↺ {tab==='own' && ( <> - {!showFolderForm && !editFolder && !sortMode && (