Skip to content

Commit

Permalink
refactor: remove unused transition config from Item component
Browse files Browse the repository at this point in the history
  • Loading branch information
DarthGigi committed Feb 2, 2025
1 parent 0190c92 commit 03f3efd
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 11 deletions.
4 changes: 1 addition & 3 deletions src/lib/components/Item.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import { Avatar, Tooltip } from "bits-ui";
import Image from "lucide-svelte/icons/image";
import { getContext } from "svelte";
import { type FadeParams } from "svelte/transition";
import Content from "./item/item-content.svelte";
type Props = {
Expand All @@ -20,9 +19,8 @@
name: string;
icon: string;
};
inTransitionConfig?: FadeParams;
};
let { piece, isInventory, showCount, showRecombobulated, tab, inTransitionConfig }: Props = $props();
let { piece, isInventory, showCount, showRecombobulated, tab }: Props = $props();
const skyblockItem = $derived(piece as ProcessedSkyBlockItem);
const bgColor = $derived(getRarityClass(piece.rarity ?? ("common".toLowerCase() as string), "bg"));
Expand Down
16 changes: 8 additions & 8 deletions src/lib/sections/stats/Inventory.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,8 @@
{/if}
</CollapsibleSection>

{#snippet itemSnippet(item: ProcessedSkyBlockItem, index: number, tab?: { name: string; icon: string })}
<Item piece={item} isInventory={true} showRecombobulated={false} showCount={true} inTransitionConfig={{ duration: 300, delay: 5 * (index + 1) }} {tab} />
{#snippet itemSnippet(item: ProcessedSkyBlockItem, tab?: { name: string; icon: string })}
<Item piece={item} isInventory={true} showRecombobulated={false} showCount={true} {tab} />
{/snippet}

{#snippet emptyItem()}
Expand All @@ -203,10 +203,10 @@
<p class="mx-auto w-fit leading-6">No items found.</p>
{:else if searchValue !== ""}
<div class="grid grid-cols-[repeat(9,minmax(1.875rem,4.875rem))] place-content-center gap-1 pt-5 @md:gap-1.5 @xl:gap-2">
{#each searchedItems as item, index}
{#each searchedItems as item}
{#if item.item}
<div class="bg-text/[0.04] flex aspect-square items-center justify-center rounded-sm">
{@render itemSnippet(item.item, index, item.sourceTab)}
{@render itemSnippet(item.item, item.sourceTab)}
</div>
{:else}
{@render emptyItem()}
Expand All @@ -224,7 +224,7 @@
<div use:builder.action {...builder} class="group">
{#if item.texture_path}
<div class="group-data-[state=active]:bg-text/10 group-data-[state=inactive]:bg-text/[0.04] flex aspect-square items-center justify-center rounded-sm">
{@render itemSnippet(item, index)}
{@render itemSnippet(item)}
</div>
{:else}
{@render emptyItem()}
Expand All @@ -246,7 +246,7 @@
<Tabs.Content value={index.toString()}>
{#if containedItem.texture_path}
<div class="bg-text/[0.04] flex aspect-square items-center justify-center rounded-sm">
{@render itemSnippet(containedItem, index2)}
{@render itemSnippet(containedItem)}
</div>
{:else}
{@render emptyItem()}
Expand All @@ -271,9 +271,9 @@
{#if item.texture_path}
<div class="bg-text/[0.04] flex aspect-square items-center justify-center rounded-sm">
{#if tab.id === "inv"}
{@render itemSnippet({ ...item, rarity: item.rarity ?? "uncommon" } as ProcessedSkyBlockItem, index)}
{@render itemSnippet({ ...item, rarity: item.rarity ?? "uncommon" } as ProcessedSkyBlockItem)}
{:else}
{@render itemSnippet(item, index)}
{@render itemSnippet(item)}
{/if}
</div>
{:else}
Expand Down

0 comments on commit 03f3efd

Please sign in to comment.