diff --git a/src/app/ItemPage.js b/src/app/ItemPage.js
index d0ebef3..85e3f57 100644
--- a/src/app/ItemPage.js
+++ b/src/app/ItemPage.js
@@ -12,7 +12,6 @@ import gql from "graphql-tag";
import { useQuery } from "@apollo/client";
import { useParams } from "react-router-dom";
-import HangerSpinner from "./components/HangerSpinner";
import {
ItemBadgeList,
ItemThumbnail,
@@ -34,7 +33,7 @@ function ItemPage() {
}
function ItemPageHeader({ itemId }) {
- const { loading, error, data } = useQuery(
+ const { error, data } = useQuery(
gql`
query ItemPage($itemId: ID!) {
item(id: $itemId) {
@@ -45,59 +44,16 @@ function ItemPageHeader({ itemId }) {
}
}
`,
- { variables: { itemId } }
+ { variables: { itemId }, returnPartialData: true }
);
usePageTitle(data?.item?.name);
- if (loading) {
- return (
-
-
-
-
-
- Item name goes here
-
-
-
-
-
-
-
- Old DTI
-
-
- Jellyneo
-
-
- Shop Wiz
-
-
- Super Wiz
-
-
- Trades
-
-
- Auctions
-
-
-
-
- );
- }
-
if (error) {
return {error.message};
}
- const { item } = data;
+ const item = data?.item;
return (
-
+
+
+
- {item.name}
+
+ {item?.name || "Item name here"}
+
@@ -122,61 +76,77 @@ function ItemPageHeader({ itemId }) {
}
function ItemPageBadges({ item }) {
+ const searchBadgesAreLoaded = item?.name != null && item?.isNc != null;
+
return (
- {item.isNc ? : }
-
- Old DTI
-
-
- Jellyneo
-
- {!item.isNc && (
+
+ {item?.isNc ? : }
+
+
+
+ Old DTI
+
+
+
- Shop Wiz
+ Jellyneo
- )}
- {!item.isNc && (
-
- Super Wiz
-
- )}
- {!item.isNc && (
-
- Trades
-
- )}
- {!item.isNc && (
-
- Auctions
-
- )}
+
+
+ {!item?.isNc && (
+
+ Shop Wiz
+
+ )}
+
+
+ {!item?.isNc && (
+
+ Super Wiz
+
+ )}
+
+
+ {!item?.isNc && (
+
+ Trades
+
+ )}
+
+
+ {!item?.isNc && (
+
+ Auctions
+
+ )}
+
);
}