Skip to content
Merged

Deploy #1740

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@
{character}
currency={concCurrency}
fullIsBad={settingsState.value.professions.fullConcentrationIsBad}
useIconOverride={false}
useStatusClass={true}
/>
{:else if field === 'moxie' && showMoxie}
<Currency {character} currency={moxieCurrency} />
<Currency {character} currency={moxieCurrency} useIconOverride={false} />
{/if}
{/each}
{/if}
Expand Down
13 changes: 11 additions & 2 deletions apps/frontend/shared/components/currencies/Currency.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,21 @@
import type { CharacterProps } from '@/types/props';

import WowthingImage from '@/shared/components/images/sources/WowthingImage.svelte';
import { currencyIconOverride } from '@/data/currencies';

type Props = CharacterProps & {
currency: StaticDataCurrency;
fullIsBad?: boolean;
useIconOverride?: boolean;
useStatusClass?: boolean;
};
let { character, currency, fullIsBad, useStatusClass }: Props = $props();
let {
character,
currency,
fullIsBad,
useIconOverride = true,
useStatusClass,
}: Props = $props();

let data = $derived(currency && getCurrencyData(timeState.slowTime, character, currency));

Expand Down Expand Up @@ -40,8 +48,9 @@
{#if data}
{@const { amount, percent, tooltip } = data}
{@const status = useStatusClass ? statusClass(percent) : ''}
{@const icon = useIconOverride ? currencyIconOverride[currency.id] : ''}
<div class="currency {status}" data-tooltip={tooltip}>
<WowthingImage name="currency/{currency.id}" size={20} border={1} />
<WowthingImage name={icon || `currency/${currency.id}`} size={20} border={1} />
<span>{amount}</span>
</div>
{:else}
Expand Down
Loading