({
posts,
badges,
size,
className,
}: {
posts: PicksWeekPost[];
badges: 'question' | 'ranked';
size: 'small' | 'large';
className?: string;
})
| 102 | * are, so the card keeps its shape while images load. |
| 103 | */ |
| 104 | const PicksStack = ({ |
| 105 | posts, |
| 106 | badges, |
| 107 | size, |
| 108 | className, |
| 109 | }: { |
| 110 | posts: PicksWeekPost[]; |
| 111 | badges: 'question' | 'ranked'; |
| 112 | size: 'small' | 'large'; |
| 113 | className?: string; |
| 114 | }): ReactElement => ( |
| 115 | <div |
| 116 | aria-hidden |
| 117 | className={classNames('flex items-center justify-center', className)} |
| 118 | > |
| 119 | {Array.from({ length: PICKS_HERO_THUMBNAILS }, (_, index) => { |
| 120 | const post = posts[index]; |
| 121 | |
| 122 | return ( |
| 123 | <div |
| 124 | key={post?.id ?? index} |
| 125 | className={classNames( |
| 126 | 'relative shrink-0 overflow-hidden rounded-10 border-2 border-background-default bg-surface-float shadow-2', |
| 127 | size === 'small' ? 'size-14' : 'size-20 rounded-14', |
| 128 | index > 0 && (size === 'small' ? '-ml-5' : '-ml-6'), |
| 129 | stackRotation[index], |
| 130 | )} |
| 131 | style={{ zIndex: index }} |
| 132 | > |
| 133 | {post && ( |
| 134 | <Image |
| 135 | src={post.image ?? undefined} |
| 136 | alt="" |
| 137 | loading="eager" |
| 138 | fallbackSrc={cloudinaryPostImageCoverPlaceholder} |
| 139 | className="size-full object-cover" |
| 140 | /> |
| 141 | )} |
| 142 | <span |
| 143 | className={classNames( |
| 144 | 'absolute flex items-center justify-center rounded-6 bg-brand-default font-bold text-white', |
| 145 | size === 'small' |
| 146 | ? 'left-1 top-1 size-5 typo-caption2' |
| 147 | : 'left-1.5 top-1.5 size-6 typo-caption1', |
| 148 | )} |
| 149 | > |
| 150 | {badges === 'question' ? '?' : index + 1} |
| 151 | </span> |
| 152 | </div> |
| 153 | ); |
| 154 | })} |
| 155 | </div> |
| 156 | ); |
| 157 | |
| 158 | const HeadlineText = ({ |
| 159 | headline, |
nothing calls this directly
no outgoing calls
no test coverage detected