habitica/website/client/src/pages/settings/components/yourBalance.vue
Natalie ae0b966f45
fix: update currency display in setting for change class (#15391)
* fix: add neededCurrencyOnly prop

* fix: worked on logic for displaying only gems

* fix: removed gold & hourglasses if neededCurrencyOnly is true

* fix: aligned gem count properly

* fix: updates based on some comments (all comments answered)

* fix: working on displaying only required currency in a new array

* chore: trying to figure out currency logic

* trying to use .find() now

* remove unneeded line of code

* still working on finding/filtering the currency

* trying to move requiredCurrency into a new function (?!)

* fix: added logic to filter for a single currency and fixed CSS

* fix: clean up code

* fix: really clean up code, sheesh

* fix: updated per comments on PR

* fix(style): vertically align elements in your-balance

---------

Co-authored-by: Kalista Payne <sabrecat@gmail.com>
2025-03-13 15:01:50 -05:00

57 lines
946 B
Vue

<template>
<div class="your-balance">
<span
v-once
class="label"
>
{{ $t('yourBalance') }}
</span>
<balance-info
class="balance-info"
:currency-needed="currencyNeeded"
:amount-needed="amountNeeded"
:neededCurrencyOnly="true"
/>
</div>
</template>
<script>
import BalanceInfo from '@/components/shops/balanceInfo.vue';
export default {
name: 'YourBalance',
components: { BalanceInfo },
props: {
currencyNeeded: {
type: String,
},
amountNeeded: {
type: Number,
},
},
};
</script>
<style scoped lang="scss">
@import '~@/assets/scss/colors.scss';
.your-balance {
padding: 8px 16px;
border-radius: 4px;
background-color: $gray-600;
display: inline-block;
align-self: center;
}
.label {
font-size: 12px;
font-weight: bold;
line-height: 1.33;
color: $gray-100;
}
.balance-info {
display: inline-block !important;
}
</style>