fix(ui): remove 'all' badge from request cards (#2992)

if all seasons are requested for a TV show, show each indivdual season badge. This prevents the
admin from needing to open a second tab / navigate to see how many seasons / what seasons have been
requested.
pull/3024/head
aedelbro 2 years ago committed by GitHub
parent d8da5cbe9d
commit 5c01313cc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -357,20 +357,13 @@ const RequestCard = ({ request, onTitleData }: RequestCardProps) => {
: request.seasons.length, : request.seasons.length,
})} })}
</span> </span>
{title.seasons.filter((season) => season.seasonNumber !== 0) <div className="hide-scrollbar overflow-x-scroll">
.length === request.seasons.length ? ( {request.seasons.map((season) => (
<span className="mr-2 uppercase"> <span key={`season-${season.id}`} className="mr-2">
<Badge>{intl.formatMessage(globalMessages.all)}</Badge> <Badge>{season.seasonNumber}</Badge>
</span> </span>
) : ( ))}
<div className="hide-scrollbar overflow-x-scroll"> </div>
{request.seasons.map((season) => (
<span key={`season-${season.id}`} className="mr-2">
<Badge>{season.seasonNumber}</Badge>
</span>
))}
</div>
)}
</div> </div>
)} )}
<div className="mt-2 flex items-center text-sm sm:mt-1"> <div className="mt-2 flex items-center text-sm sm:mt-1">

@ -420,20 +420,13 @@ const RequestItem = ({ request, revalidateList }: RequestItemProps) => {
: request.seasons.length, : request.seasons.length,
})} })}
</span> </span>
{title.seasons.filter((season) => season.seasonNumber !== 0) <div className="hide-scrollbar flex flex-nowrap overflow-x-scroll">
.length === request.seasons.length ? ( {request.seasons.map((season) => (
<span className="mr-2 uppercase"> <span key={`season-${season.id}`} className="mr-2">
<Badge>{intl.formatMessage(globalMessages.all)}</Badge> <Badge>{season.seasonNumber}</Badge>
</span> </span>
) : ( ))}
<div className="hide-scrollbar flex flex-nowrap overflow-x-scroll"> </div>
{request.seasons.map((season) => (
<span key={`season-${season.id}`} className="mr-2">
<Badge>{season.seasonNumber}</Badge>
</span>
))}
</div>
)}
</div> </div>
)} )}
</div> </div>

Loading…
Cancel
Save