diff --git a/src/ItemList.js b/src/ItemList.js
index 659d2a23..b03f63b3 100644
--- a/src/ItemList.js
+++ b/src/ItemList.js
@@ -1,5 +1,5 @@
import React from "react";
-import { Box, Image, PseudoBox, Stack } from "@chakra-ui/core";
+import { Box, Image, PseudoBox, Stack, Skeleton } from "@chakra-ui/core";
function ItemList({ items, wornItemIds, onWearItem }) {
return (
@@ -17,6 +17,22 @@ function ItemList({ items, wornItemIds, onWearItem }) {
);
}
+function ItemListSkeleton() {
+ return (
+
+
+
+
+
+
+
+
+
+
+
+ );
+}
+
function Item({ item, isWorn, onWear }) {
return (
+
+
+
+
+ );
+}
+
function ItemThumbnail({ src, isWorn }) {
return (
{
+ if (error) {
+ toast({
+ title: "We couldn't load this outfit 😖",
+ description: "Please reload the page to try again. Sorry!",
+ status: "error",
+ isClosable: true,
+ duration: Infinity,
+ });
+ }
+ }, [error, toast]);
+
return (
)}
@@ -191,21 +205,29 @@ function SearchPanel({ query, wornItemIds, onWearItem }) {
);
}
-function ItemsPanel({ zonesAndItems, onWearItem }) {
+function ItemsPanel({ zonesAndItems, loading, onWearItem }) {
return (
- {zonesAndItems.map(({ zoneName, items, wornItemId }) => (
-
- {zoneName}
-
-
- ))}
+ {loading &&
+ [1, 2, 3].map((i) => (
+
+
+
+
+ ))}
+ {!loading &&
+ zonesAndItems.map(({ zoneName, items, wornItemId }) => (
+
+ {zoneName}
+
+
+ ))}
);
@@ -213,21 +235,23 @@ function ItemsPanel({ zonesAndItems, onWearItem }) {
function OutfitHeading() {
return (
-
-
-
- {({ isEditing, onRequestEdit }) => (
- <>
-
-
- {!isEditing && (
-
- )}
- >
- )}
-
-
-
+
+
+
+
+ {({ isEditing, onRequestEdit }) => (
+ <>
+
+
+ {!isEditing && (
+
+ )}
+ >
+ )}
+
+
+
+
);
}