add pb badge to pb items, instead of nc/np badge
This commit is contained in:
parent
02e173d7de
commit
d02f7ced72
6 changed files with 34 additions and 25 deletions
|
@ -30,9 +30,8 @@ import { useParams } from "react-router-dom";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
ItemBadgeList,
|
ItemBadgeList,
|
||||||
|
ItemKindBadge,
|
||||||
ItemThumbnail,
|
ItemThumbnail,
|
||||||
NcBadge,
|
|
||||||
NpBadge,
|
|
||||||
} from "./components/ItemCard";
|
} from "./components/ItemCard";
|
||||||
import { Delay, Heading1, usePageTitle } from "./util";
|
import { Delay, Heading1, usePageTitle } from "./util";
|
||||||
import {
|
import {
|
||||||
|
@ -76,6 +75,7 @@ function ItemPageHeader({ itemId, isEmbedded }) {
|
||||||
id
|
id
|
||||||
name
|
name
|
||||||
isNc
|
isNc
|
||||||
|
isPb
|
||||||
thumbnailUrl
|
thumbnailUrl
|
||||||
description
|
description
|
||||||
createdAt
|
createdAt
|
||||||
|
@ -150,7 +150,7 @@ function ItemPageBadges({ item, isEmbedded }) {
|
||||||
return (
|
return (
|
||||||
<ItemBadgeList marginTop="1">
|
<ItemBadgeList marginTop="1">
|
||||||
<SubtleSkeleton isLoaded={item?.isNc != null}>
|
<SubtleSkeleton isLoaded={item?.isNc != null}>
|
||||||
{item?.isNc ? <NcBadge /> : <NpBadge />}
|
<ItemKindBadge isNc={item.isNc} isPb={item.isPb} />
|
||||||
</SubtleSkeleton>
|
</SubtleSkeleton>
|
||||||
{
|
{
|
||||||
// If the createdAt date is null (loaded and empty), hide the badge.
|
// If the createdAt date is null (loaded and empty), hide the badge.
|
||||||
|
@ -192,7 +192,7 @@ function ItemPageBadges({ item, isEmbedded }) {
|
||||||
</LinkBadge>
|
</LinkBadge>
|
||||||
</SubtleSkeleton>
|
</SubtleSkeleton>
|
||||||
<SubtleSkeleton isLoaded={searchBadgesAreLoaded}>
|
<SubtleSkeleton isLoaded={searchBadgesAreLoaded}>
|
||||||
{!item?.isNc && (
|
{!item?.isNc && !item?.isPb && (
|
||||||
<LinkBadge
|
<LinkBadge
|
||||||
href={
|
href={
|
||||||
"http://www.neopets.com/market.phtml?type=wizard&string=" +
|
"http://www.neopets.com/market.phtml?type=wizard&string=" +
|
||||||
|
@ -205,7 +205,7 @@ function ItemPageBadges({ item, isEmbedded }) {
|
||||||
)}
|
)}
|
||||||
</SubtleSkeleton>
|
</SubtleSkeleton>
|
||||||
<SubtleSkeleton isLoaded={searchBadgesAreLoaded}>
|
<SubtleSkeleton isLoaded={searchBadgesAreLoaded}>
|
||||||
{!item?.isNc && (
|
{!item?.isNc && !item?.isPb && (
|
||||||
<LinkBadge
|
<LinkBadge
|
||||||
href={
|
href={
|
||||||
"http://www.neopets.com/portal/supershopwiz.phtml?string=" +
|
"http://www.neopets.com/portal/supershopwiz.phtml?string=" +
|
||||||
|
@ -218,7 +218,7 @@ function ItemPageBadges({ item, isEmbedded }) {
|
||||||
)}
|
)}
|
||||||
</SubtleSkeleton>
|
</SubtleSkeleton>
|
||||||
<SubtleSkeleton isLoaded={searchBadgesAreLoaded}>
|
<SubtleSkeleton isLoaded={searchBadgesAreLoaded}>
|
||||||
{!item?.isNc && (
|
{!item?.isNc && !item?.isPb && (
|
||||||
<LinkBadge
|
<LinkBadge
|
||||||
href={
|
href={
|
||||||
"http://www.neopets.com/island/tradingpost.phtml?type=browse&criteria=item_exact&search_string=" +
|
"http://www.neopets.com/island/tradingpost.phtml?type=browse&criteria=item_exact&search_string=" +
|
||||||
|
@ -231,7 +231,7 @@ function ItemPageBadges({ item, isEmbedded }) {
|
||||||
)}
|
)}
|
||||||
</SubtleSkeleton>
|
</SubtleSkeleton>
|
||||||
<SubtleSkeleton isLoaded={searchBadgesAreLoaded}>
|
<SubtleSkeleton isLoaded={searchBadgesAreLoaded}>
|
||||||
{!item?.isNc && (
|
{!item?.isNc && !item?.isPb && (
|
||||||
<LinkBadge
|
<LinkBadge
|
||||||
href={
|
href={
|
||||||
"http://www.neopets.com/genie.phtml?type=process_genie&criteria=exact&auctiongenie=" +
|
"http://www.neopets.com/genie.phtml?type=process_genie&criteria=exact&auctiongenie=" +
|
||||||
|
|
|
@ -13,8 +13,7 @@ import { Heading1, Heading2, Heading3 } from "./util";
|
||||||
import ItemCard, {
|
import ItemCard, {
|
||||||
ItemBadgeList,
|
ItemBadgeList,
|
||||||
ItemCardList,
|
ItemCardList,
|
||||||
NcBadge,
|
ItemKindBadge,
|
||||||
NpBadge,
|
|
||||||
YouOwnThisBadge,
|
YouOwnThisBadge,
|
||||||
YouWantThisBadge,
|
YouWantThisBadge,
|
||||||
getZoneBadges,
|
getZoneBadges,
|
||||||
|
@ -44,6 +43,7 @@ function UserItemsPage() {
|
||||||
items {
|
items {
|
||||||
id
|
id
|
||||||
isNc
|
isNc
|
||||||
|
isPb
|
||||||
name
|
name
|
||||||
thumbnailUrl
|
thumbnailUrl
|
||||||
currentUserOwnsThis
|
currentUserOwnsThis
|
||||||
|
@ -256,7 +256,7 @@ function ClosetList({ closetList, isCurrentUser, showHeading }) {
|
||||||
item={item}
|
item={item}
|
||||||
badges={
|
badges={
|
||||||
<ItemBadgeList>
|
<ItemBadgeList>
|
||||||
{item.isNc ? <NcBadge /> : <NpBadge />}
|
<ItemKindBadge isNc={item.isNc} isPb={item.isPb} />
|
||||||
{hasYouOwnThisBadge(item) && <YouOwnThisBadge />}
|
{hasYouOwnThisBadge(item) && <YouOwnThisBadge />}
|
||||||
{hasYouWantThisBadge(item) && <YouWantThisBadge />}
|
{hasYouWantThisBadge(item) && <YouWantThisBadge />}
|
||||||
{getZoneBadges(item.allOccupiedZones, {
|
{getZoneBadges(item.allOccupiedZones, {
|
||||||
|
|
|
@ -16,9 +16,8 @@ import loadable from "@loadable/component";
|
||||||
import {
|
import {
|
||||||
ItemCardContent,
|
ItemCardContent,
|
||||||
ItemBadgeList,
|
ItemBadgeList,
|
||||||
|
ItemKindBadge,
|
||||||
MaybeAnimatedBadge,
|
MaybeAnimatedBadge,
|
||||||
NcBadge,
|
|
||||||
NpBadge,
|
|
||||||
YouOwnThisBadge,
|
YouOwnThisBadge,
|
||||||
YouWantThisBadge,
|
YouWantThisBadge,
|
||||||
getZoneBadges,
|
getZoneBadges,
|
||||||
|
@ -211,17 +210,7 @@ function ItemBadges({ item }) {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<ItemBadgeList>
|
<ItemBadgeList>
|
||||||
{item.isNc ? (
|
<ItemKindBadge isNc={item.isNc} isPb={item.isPb} />
|
||||||
<NcBadge />
|
|
||||||
) : (
|
|
||||||
// The main purpose of the NP badge is alignment: if there are
|
|
||||||
// zone badges, we want them to start at the same rough position,
|
|
||||||
// even if there's an NC badge at the start. But if this view
|
|
||||||
// generally avoids zone badges, we'd rather have the NC badge be
|
|
||||||
// a little extra that might pop up and hide the NP case, rather
|
|
||||||
// than try to line things up like a table.
|
|
||||||
<NpBadge />
|
|
||||||
)}
|
|
||||||
{
|
{
|
||||||
// This badge is unreliable, but it's helpful for looking for animated
|
// This badge is unreliable, but it's helpful for looking for animated
|
||||||
// items to test, so we show it only to support. We use this form
|
// items to test, so we show it only to support. We use this form
|
||||||
|
|
|
@ -280,6 +280,7 @@ function useSearchResults(query, outfitState) {
|
||||||
name
|
name
|
||||||
thumbnailUrl
|
thumbnailUrl
|
||||||
isNc
|
isNc
|
||||||
|
isPb
|
||||||
currentUserOwnsThis
|
currentUserOwnsThis
|
||||||
currentUserWantsThis
|
currentUserWantsThis
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ function useOutfitState() {
|
||||||
name
|
name
|
||||||
thumbnailUrl
|
thumbnailUrl
|
||||||
isNc
|
isNc
|
||||||
|
isPb
|
||||||
currentUserOwnsThis
|
currentUserOwnsThis
|
||||||
currentUserWantsThis
|
currentUserWantsThis
|
||||||
|
|
||||||
|
|
|
@ -230,8 +230,6 @@ export function NcBadge() {
|
||||||
}
|
}
|
||||||
|
|
||||||
export function NpBadge() {
|
export function NpBadge() {
|
||||||
// NOTE: display:block helps with some layout consistency, overriding the
|
|
||||||
// default of inline-block.
|
|
||||||
return (
|
return (
|
||||||
<ItemBadgeTooltip label="Neopoints">
|
<ItemBadgeTooltip label="Neopoints">
|
||||||
<Badge display="block">NP</Badge>
|
<Badge display="block">NP</Badge>
|
||||||
|
@ -239,6 +237,26 @@ export function NpBadge() {
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function PbBadge() {
|
||||||
|
return (
|
||||||
|
<ItemBadgeTooltip label="This item is only obtainable via paintbrush">
|
||||||
|
<Badge colorScheme="orange" display="block">
|
||||||
|
PB
|
||||||
|
</Badge>
|
||||||
|
</ItemBadgeTooltip>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
export function ItemKindBadge({ isNc, isPb }) {
|
||||||
|
if (isNc) {
|
||||||
|
return <NcBadge />;
|
||||||
|
} else if (isPb) {
|
||||||
|
return <PbBadge />;
|
||||||
|
} else {
|
||||||
|
return <NpBadge />;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
export function YouOwnThisBadge({ variant = "long" }) {
|
export function YouOwnThisBadge({ variant = "long" }) {
|
||||||
let badge = (
|
let badge = (
|
||||||
<Badge
|
<Badge
|
||||||
|
|
Loading…
Reference in a new issue