Fix expand button display in Magazine, Masonry and Timeline layouts
Some checks failed
continuous-integration/drone/push Build is failing
Some checks failed
continuous-integration/drone/push Build is failing
- Fixed data mapping for ExpandableGroup components in all three layouts - Increased initialShowCount for magazine layout (8 for first, 6 for others) - Fixed overlay settings to use link_overlay instead of group_overlay in masonry layout - Added debug logging to ExpandableGroup to help diagnose issues - All layouts now properly convert group.links to ExpandableGroup format with icon mapping Issues fixed: - Timeline layout: Now properly maps link data with icons - Magazine layout: Increased link count and fixed data mapping - Masonry layout: Fixed overlay settings and data mapping
This commit is contained in:
@@ -617,11 +617,17 @@ export default function UserPage({
|
||||
<p className="text-muted small mb-3">{group.description}</p>
|
||||
)}
|
||||
<ExpandableGroup
|
||||
links={group.links}
|
||||
links={group.links.map(link => ({
|
||||
id: link.id,
|
||||
title: link.title,
|
||||
url: link.url,
|
||||
description: link.description,
|
||||
image: designSettings.show_link_icons ? link.icon_url : undefined
|
||||
}))}
|
||||
layout="cards"
|
||||
initialShowCount={8}
|
||||
overlayColor={designSettings.group_overlay_enabled ? designSettings.group_overlay_color : undefined}
|
||||
overlayOpacity={designSettings.group_overlay_enabled ? designSettings.group_overlay_opacity : undefined}
|
||||
overlayColor={designSettings.link_overlay_enabled ? designSettings.link_overlay_color : undefined}
|
||||
overlayOpacity={designSettings.link_overlay_enabled ? designSettings.link_overlay_opacity : undefined}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
@@ -694,7 +700,13 @@ export default function UserPage({
|
||||
</p>
|
||||
)}
|
||||
<ExpandableGroup
|
||||
links={group.links}
|
||||
links={group.links.map(link => ({
|
||||
id: link.id,
|
||||
title: link.title,
|
||||
url: link.url,
|
||||
description: link.description,
|
||||
image: designSettings.show_link_icons ? link.icon_url : undefined
|
||||
}))}
|
||||
layout="timeline"
|
||||
initialShowCount={5}
|
||||
overlayColor={designSettings.link_overlay_enabled ? designSettings.link_overlay_color : undefined}
|
||||
@@ -780,9 +792,15 @@ export default function UserPage({
|
||||
</p>
|
||||
<div className="links-preview">
|
||||
<ExpandableGroup
|
||||
links={group.links}
|
||||
links={group.links.map(link => ({
|
||||
id: link.id,
|
||||
title: link.title,
|
||||
url: link.url,
|
||||
description: link.description,
|
||||
image: designSettings.show_link_icons ? link.icon_url : undefined
|
||||
}))}
|
||||
layout="magazine"
|
||||
initialShowCount={index === 0 ? 5 : 3}
|
||||
initialShowCount={index === 0 ? 8 : 6}
|
||||
overlayColor={designSettings.link_overlay_enabled ? designSettings.link_overlay_color : undefined}
|
||||
overlayOpacity={designSettings.link_overlay_enabled ? designSettings.link_overlay_opacity : undefined}
|
||||
/>
|
||||
|
||||
@@ -37,7 +37,11 @@ export function ExpandableGroup({
|
||||
opacity: overlayOpacity
|
||||
} : undefined
|
||||
|
||||
// Добавляем отладочную информацию
|
||||
console.log(`ExpandableGroup: ${links.length} links, initialShowCount: ${initialShowCount}, layout: ${layout}`)
|
||||
|
||||
if (links.length <= initialShowCount) {
|
||||
console.log(`No expand button needed: ${links.length} <= ${initialShowCount}`)
|
||||
return (
|
||||
<div className={className}>
|
||||
{links.map((link) => (
|
||||
@@ -57,6 +61,8 @@ export function ExpandableGroup({
|
||||
const visibleLinks = isExpanded ? links : links.slice(0, initialShowCount)
|
||||
const hiddenCount = links.length - initialShowCount
|
||||
|
||||
console.log(`Showing expand button: visibleLinks: ${visibleLinks.length}, hiddenCount: ${hiddenCount}`)
|
||||
|
||||
return (
|
||||
<div className={className}>
|
||||
{visibleLinks.map((link) => (
|
||||
|
||||
Reference in New Issue
Block a user