From c3422c6740597d980e5f6bb6d5c4ae173184be4e Mon Sep 17 00:00:00 2001 From: Joe Date: Thu, 27 Jun 2024 10:05:19 -0400 Subject: [PATCH] Start Recommendations slider at middle --- src/app/_content/Recommendations.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/app/_content/Recommendations.tsx b/src/app/_content/Recommendations.tsx index 42d90a8..b6f997e 100644 --- a/src/app/_content/Recommendations.tsx +++ b/src/app/_content/Recommendations.tsx @@ -18,11 +18,13 @@ import Image from "next/image" import { useEffect, useState } from "react" export default function Recommendations() { - const [api, setApi] = useState() - const [current, setCurrent] = useState(0) const { data } = useApi() + const [api, setApi] = useState() const recommendations: RecommendationType[] = data.recommendations.attributes.recommendations + const [current, setCurrent] = useState( + Math.floor(recommendations.length / 2), + ) useEffect(() => { if (!api) return