fix: feed column layout

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei
2024-08-08 17:39:41 +08:00
parent 19eaa058c9
commit 8a31463e4e
@@ -249,12 +249,15 @@ export function FeedColumn({ children }: PropsWithChildren) {
</ActionButton>
))}
</div>
<div className="size-full overflow-hidden" ref={carouselRef}>
<div className="relative size-full overflow-hidden" ref={carouselRef}>
<SwipeWrapper active={active} spring={spring}>
{views.map((item, index) => (
<section
key={item.name}
className="h-full w-[var(--fo-feed-col-w)] shrink-0 snap-center"
className="absolute h-full w-[var(--fo-feed-col-w)] shrink-0 snap-center"
style={{
left: `${index * 100}%`,
}}
>
{active === index && (
<FeedList
@@ -282,7 +285,7 @@ const SwipeWrapper: Component<{
if (reduceMotion) {
return (
<div
className="flex h-full"
className="absolute inset-0"
style={{
transform: `translateX(${-active * carouselWidth}px)`,
}}
@@ -293,7 +296,7 @@ const SwipeWrapper: Component<{
}
return (
<m.div
className="flex h-full"
className="absolute inset-0"
style={{
x: spring,
}}