diff --git a/src/features/quicklinks/QuickLinks.jsx b/src/features/quicklinks/QuickLinks.jsx index 97b91c8d..c395d512 100644 --- a/src/features/quicklinks/QuickLinks.jsx +++ b/src/features/quicklinks/QuickLinks.jsx @@ -19,11 +19,13 @@ const QuickLinks = memo(() => { if (!element) return; const zoom = localStorage.getItem('zoomQuicklinks') || 100; + const style = localStorage.getItem('quickLinksStyle') || 'card'; + for (const link of element.getElementsByTagName('span')) { link.style.fontSize = `${14 * Number(zoom / 100)}px`; } - if (localStorage.getItem('quickLinksStyle') !== 'text_only') { + if (style !== 'text_only') { for (const img of element.getElementsByTagName('img')) { img.style.height = `${30 * Number(zoom / 100)}px`; } @@ -81,7 +83,11 @@ const QuickLinks = memo(() => { const tooltipEnabled = localStorage.getItem('quicklinkstooltip'); const quickLink = (item, index) => { - if (localStorage.getItem('quickLinksStyle') === 'text_only') { + const zoom = localStorage.getItem('zoomQuicklinks') || 100; + const iconSize = 30 * Number(zoom / 100); + const style = localStorage.getItem('quickLinksStyle') || 'card'; + + if (style === 'text_only') { return ( { ); } - const zoom = localStorage.getItem('zoomQuicklinks') || 100; - const iconSize = 30 * Number(zoom / 100); - - if (localStorage.getItem('quickLinksStyle') === 'metro') { + if (style === 'metro') { return ( { ); } + if (style === 'card') { + return ( + +
+ +
+ {item.name} +
+ ); + } + + // Default icon style const link = ( { - return ( -
-
- -
- {title} - {subtitle} -
-
-
- -
-
- ); -}; - const QuickLinksOptions = ({ currentSubSection, onSubSectionChange, sectionName }) => { const [items, setItems] = useState(readQuicklinks()); const [showAddModal, setShowAddModal] = useState(false); @@ -239,6 +221,7 @@ const QuickLinksOptions = ({ currentSubSection, onSubSectionChange, sectionName name="quickLinksStyle" category="quicklinks" items={[ + { value: 'card', text: 'Card' }, { value: 'icon', text: variables.getMessage(`${QUICKLINKS_SECTION}.options.icon`) }, { value: 'text_only', @@ -351,10 +334,23 @@ const QuickLinksOptions = ({ currentSubSection, onSubSectionChange, sectionName const [syncStatus, setSyncStatus] = useState(''); const [syncing, setSyncing] = useState(false); + const handleSyncToggle = (value) => { + const config = JSON.parse(localStorage.getItem('quicklinks_config') || '{}'); + config.bookmarkSyncEnabled = value; + localStorage.setItem('quicklinks_config', JSON.stringify(config)); + }; + const handleSync = async () => { setSyncing(true); setSyncStatus('Syncing...'); try { + // Enable sync first if not already enabled + const config = JSON.parse(localStorage.getItem('quicklinks_config') || '{}'); + if (!config.bookmarkSyncEnabled) { + config.bookmarkSyncEnabled = true; + localStorage.setItem('quicklinks_config', JSON.stringify(config)); + } + const hasPermission = await BookmarkService.checkPermissions(); if (!hasPermission) { const granted = await BookmarkService.requestPermissions(); @@ -377,22 +373,38 @@ const QuickLinksOptions = ({ currentSubSection, onSubSectionChange, sectionName }; return ( - - - -