From 13e5974114f759bae73f3bfd68c62ce9cfaf785e Mon Sep 17 00:00:00 2001
From: mat <github@matdoes.dev>
Date: Sun, 20 Feb 2022 21:38:14 -0600
Subject: add more stuff to profile and fix bugs

---
 src/lib/minecraft/Item.svelte | 21 ++++++++++++---------
 1 file changed, 12 insertions(+), 9 deletions(-)

(limited to 'src/lib/minecraft/Item.svelte')

diff --git a/src/lib/minecraft/Item.svelte b/src/lib/minecraft/Item.svelte
index c944f1b..9f2dcc3 100644
--- a/src/lib/minecraft/Item.svelte
+++ b/src/lib/minecraft/Item.svelte
@@ -17,12 +17,12 @@
 	$: imageUrl = item ? itemToUrl(item, pack) : null
 </script>
 
-<MinecraftTooltip>
-	<span slot="name">{@html itemNameHtml}</span>
-	<span slot="lore">{@html itemLoreHtml}</span>
-	<span class="item" class:item-slot={isslot}>
-		<!-- we have an if here because the item might be air -->
-		{#if item}
+{#if item}
+	<MinecraftTooltip>
+		<span slot="name">{@html itemNameHtml}</span>
+		<span slot="lore">{@html itemLoreHtml}</span>
+		<span class="item" class:item-slot={isslot}>
+			<!-- we have an if here because the item might be air -->
 			{#if imageUrl}
 				<img
 					loading="lazy"
@@ -34,9 +34,12 @@
 			{#if item.count !== 1}
 				<span class="item-count">{item.count}</span>
 			{/if}
-		{/if}
-	</span>
-</MinecraftTooltip>
+		</span>
+	</MinecraftTooltip>
+{:else}
+	<!-- don't do all that if the item doesn't actually exist -->
+	<span class="item" class:item-slot={isslot} />
+{/if}
 
 <style>
 	.item {
-- 
cgit 

