Add PB badge to items in search / homepage

Oh right, labeling PB items as NP is confusing! Here, we add a "PB" case to the lil badge on the corner of the item thumbnail, in item search page & homepage Newest Items.
This commit is contained in:
Emi Matchu 2021-05-13 16:24:24 -07:00
parent 2c043adbe0
commit eec73d245b
3 changed files with 11 additions and 7 deletions

View file

@ -380,6 +380,7 @@ function NewItemsSectionContent() {
name name
thumbnailUrl thumbnailUrl
isNc isNc
isPb
} }
} }
` `

View file

@ -145,6 +145,7 @@ function ItemSearchPageResults({ query: latestQuery, offset }) {
name name
thumbnailUrl thumbnailUrl
isNc isNc
isPb
} }
} }
} }

View file

@ -95,17 +95,19 @@ function SquareItemCardLayout({ name, thumbnailImage, minHeightNumLines = 2 }) {
function ItemThumbnail({ item }) { function ItemThumbnail({ item }) {
const mdRadiusValue = useToken("radii", "md"); const mdRadiusValue = useToken("radii", "md");
const colorScheme = item.isNc ? "purple" : item.isPb ? "orange" : "gray";
const badgeBackground = useColorModeValue( const badgeBackground = useColorModeValue(
item.isNc ? "purple.100" : "gray.100", `${colorScheme}.100`,
item.isNc ? "purple.500" : "gray.500" `${colorScheme}.500`
); );
const badgeColor = useColorModeValue( const badgeColor = useColorModeValue(
item.isNc ? "purple.500" : "gray.500", `${colorScheme}.500`,
item.isNc ? "purple.100" : "gray.100" `${colorScheme}.100`
); );
const thumbnailShadowColor = useColorModeValue( const thumbnailShadowColor = useColorModeValue(
item.isNc ? "purple.200" : "gray.200", `${colorScheme}.200`,
item.isNc ? "purple.600" : "gray.600" `${colorScheme}.600`
); );
const [ const [
@ -158,7 +160,7 @@ function ItemThumbnail({ item }) {
color: ${badgeColorValue}; color: ${badgeColorValue};
`} `}
> >
{item.isNc ? "NC" : "NP"} {item.isNc ? "NC" : item.isPb ? "PB" : "NP"}
</div> </div>
)} )}
</div> </div>