Skip to content

Commit

Permalink
Start Recommendations slider at middle
Browse files Browse the repository at this point in the history
  • Loading branch information
josephdburdick committed Jun 27, 2024
1 parent 190736f commit c3422c6
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/app/_content/Recommendations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ import Image from "next/image"
import { useEffect, useState } from "react"

export default function Recommendations() {
const [api, setApi] = useState<CarouselApi>()
const [current, setCurrent] = useState(0)
const { data } = useApi()
const [api, setApi] = useState<CarouselApi>()
const recommendations: RecommendationType[] =
data.recommendations.attributes.recommendations
const [current, setCurrent] = useState(
Math.floor(recommendations.length / 2),
)

useEffect(() => {
if (!api) return
Expand Down

0 comments on commit c3422c6

Please sign in to comment.