@@ -17,26 +17,29 @@ const PostItem = ({ slug, title, date, updatedDate, category }) => {
1717 year : 'numeric' ,
1818 } ) : null ;
1919
20- const categoryBadgeColorClass = category === 'dev' ? 'bg-blue-700' : 'bg-orange-700' ;
21- const postBackgroundColorClass = category === 'dev' ? 'bg-blue-900/20 hover:bg-blue-900/40' : 'bg-orange-900/20 hover:bg-orange-900/40' ;
20+ const categoryBadgeColorStyle = { backgroundColor : category === 'dev' ? 'var(--color-dev-badge)' : 'var(--color-takes-badge)' } ;
21+ const postBackgroundColorStyle = {
22+ backgroundColor : category === 'dev' ? 'var(--color-dev-card-bg)' : 'var(--color-takes-card-bg)' ,
23+ '--hover-bg' : category === 'dev' ? 'var(--color-dev-card-bg-hover)' : 'var(--color-takes-card-bg-hover)' ,
24+ } ;
2225
2326 return (
24- < Link to = { `/blog/${ slug } ` } className = { `block p-8 my-4 border border-gray-700/50 rounded-lg shadow-lg cursor-pointer transition-colors ${ postBackgroundColorClass } ` } >
27+ < Link to = { `/blog/${ slug } ` } className = { `block p-8 my-4 border border-gray-700/50 rounded-lg shadow-lg cursor-pointer transition-colors group` } style = { postBackgroundColorStyle } >
2528 < article >
2629 < div className = "flex items-center" >
2730 < p className = "text-sm text-gray-400" > { formattedDate } </ p >
2831 < div className = "ml-4 flex-grow flex items-center" >
2932 { category && (
30- < span className = { `mr-2 px-2 py-1 text-xs font-medium text-white rounded-md ${ categoryBadgeColorClass } hidden sm:inline-block w-16 text-center` } >
33+ < span className = { `mr-2 px-2 py-1 text-xs font-medium text-white rounded-md hidden sm:inline-block w-16 text-center` } style = { categoryBadgeColorStyle } >
3134 { category }
3235 </ span >
3336 ) }
34- < h2 className = "text-xl font-semibold text-white hover:text-primary-400 transition-colors" >
37+ < h2 className = "text-xl font-semibold text-white group- hover:text-primary-400 transition-colors" >
3538 { title }
3639 </ h2 >
3740 </ div >
3841 { formattedUpdatedDate && updatedDate !== date && (
39- < span className = "hidden sm:inline-block ml-4 px-2 py-1 text-xs font-medium text-blue -400 bg-blue -400/10 rounded-full" > Updated: { formattedUpdatedDate } </ span >
42+ < span className = "hidden sm:inline-block ml-4 px-2 py-1 text-xs font-medium text-orange -400 bg-orange -400/10 rounded-full" > Updated: { formattedUpdatedDate } </ span >
4043 ) }
4144 < span className = "ml-4 flex-shrink-0 text-sm font-medium text-primary-400 hover:text-primary-500 transition-colors" >
4245 < span className = "hidden sm:inline" > Read post</ span > →
0 commit comments