11import { useState , useEffect , useRef } from 'react'
22import { ChevronLeftIcon , ChevronRightIcon } from '@primer/octicons-react'
3- import { Token } from '@primer/react'
43import cx from 'classnames'
54import type { ResolvedArticle } from '@/types'
65import { useTranslation } from '@/languages/components/useTranslation'
@@ -78,11 +77,11 @@ export const LandingCarousel = ({ heading = '', recommended }: LandingCarouselPr
7877 setCurrentPage ( ( prev ) => Math . max ( 0 , prev - 1 ) )
7978
8079 // Set animation state to false after transition completes
81- // Duration matches CSS custom property --carousel-transition-duration (300ms )
80+ // Duration matches CSS custom property --carousel-transition-duration (100ms )
8281 animationTimeoutRef . current = setTimeout ( ( ) => {
8382 setIsAnimating ( false )
8483 animationTimeoutRef . current = null
85- } , 300 )
84+ } , 100 )
8685 }
8786
8887 const goToNext = ( ) => {
@@ -97,11 +96,11 @@ export const LandingCarousel = ({ heading = '', recommended }: LandingCarouselPr
9796 setCurrentPage ( ( prev ) => Math . min ( totalPages - 1 , prev + 1 ) )
9897
9998 // Set animation state to false after transition completes
100- // Duration matches CSS custom property --carousel-transition-duration (300ms )
99+ // Duration matches CSS custom property --carousel-transition-duration (100ms )
101100 animationTimeoutRef . current = setTimeout ( ( ) => {
102101 setIsAnimating ( false )
103102 animationTimeoutRef . current = null
104- } , 300 )
103+ } , 100 )
105104 }
106105
107106 // Calculate the start index based on current page
@@ -144,27 +143,21 @@ export const LandingCarousel = ({ heading = '', recommended }: LandingCarouselPr
144143 data-testid = "carousel-items"
145144 >
146145 { visibleItems . map ( ( article : ResolvedArticle , index ) => (
147- < div
146+ < a
148147 key = { startIndex + index }
148+ href = { article . href }
149149 className = { cx ( styles . articleCard , 'border' , 'border-default' , 'rounded-2' ) }
150150 >
151- < div className = "mb-2" >
152- { article . category . map ( ( cat : string ) => (
153- < Token key = { cat } text = { cat } className = "mr-1 mb-2" />
154- ) ) }
155- </ div >
156151 < h3 className = { styles . articleTitle } >
157- < a href = { article . href } className = { styles . articleLink } >
158- { article . title }
159- </ a >
152+ < span className = { styles . articleLink } > { article . title } </ span >
160153 </ h3 >
161154 < div
162155 className = { styles . articleDescription }
163156 dangerouslySetInnerHTML = { {
164157 __html : article . intro as TrustedHTML ,
165158 } }
166159 />
167- </ div >
160+ </ a >
168161 ) ) }
169162 </ div >
170163 </ div >
0 commit comments