调整更多推荐和豆瓣评论的边距

This commit is contained in:
mtvpls
2025-12-27 16:59:47 +08:00
parent 91cdb7a1d2
commit 263765d25f
4 changed files with 14 additions and 12 deletions

View File

@@ -112,7 +112,7 @@ export default function DoubanRecommendations({ doubanId }: DoubanRecommendation
}
return (
<ScrollableRow scrollDistance={600}>
<ScrollableRow scrollDistance={600} bottomPadding='pb-2'>
{recommendations.map((rec) => (
<div
key={rec.doubanId}

View File

@@ -4,11 +4,13 @@ import { useEffect, useRef, useState } from 'react';
interface ScrollableRowProps {
children: React.ReactNode;
scrollDistance?: number;
bottomPadding?: string;
}
export default function ScrollableRow({
children,
scrollDistance = 1000,
bottomPadding = 'pb-12 sm:pb-14',
}: ScrollableRowProps) {
const containerRef = useRef<HTMLDivElement>(null);
const [showLeftScroll, setShowLeftScroll] = useState(false);
@@ -102,7 +104,7 @@ export default function ScrollableRow({
>
<div
ref={containerRef}
className='flex space-x-6 overflow-x-auto scrollbar-hide py-1 sm:py-2 pb-12 sm:pb-14 px-4 sm:px-6'
className={`flex space-x-6 overflow-x-auto scrollbar-hide py-1 sm:py-2 ${bottomPadding} px-4 sm:px-6`}
onScroll={checkScroll}
>
{children}