Show boursecu assets per product from wallet API and scale day range for maftol.
Fix rules paragraph alignment so Persian text does not stretch with justify. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -4,7 +4,8 @@ import BasicIcon from '@/components/BasicPacks/BasicIcon.vue'
|
||||
import { usePriceWithoutType } from '@/utils/usePrice'
|
||||
import { useWalletAssets } from '@/composables/useWalletAssets'
|
||||
import type { WalletMetalTotal } from '@/models/walletAssets'
|
||||
import { resolveSummaryMetalWeight } from '@/utils/productAssets'
|
||||
import { buildBoursecuHomeAssetRows, resolveSummaryMetalWeight } from '@/utils/productAssets'
|
||||
import { useHomePageContext } from '../../composables/useHomePage'
|
||||
|
||||
const emit = defineEmits<{
|
||||
openGoldModal: [metal: WalletMetalTotal]
|
||||
@@ -12,6 +13,8 @@ const emit = defineEmits<{
|
||||
}>()
|
||||
|
||||
const { assetsSummary } = useWalletAssets()
|
||||
const ctx = useHomePageContext()
|
||||
const isBoursecuLayout = computed(() => ctx.isBoursecuHomeLayout.value)
|
||||
|
||||
const meta = computed(() => assetsSummary.value?.meta)
|
||||
const metalTotals = computed(() => assetsSummary.value?.metal_totals ?? [])
|
||||
@@ -41,6 +44,20 @@ const metrics = computed<MetricItem[]>(() => {
|
||||
})
|
||||
}
|
||||
|
||||
if (isBoursecuLayout.value) {
|
||||
buildBoursecuHomeAssetRows(assetsSummary.value).forEach((row) => {
|
||||
items.push({
|
||||
id: row.id,
|
||||
label: row.label,
|
||||
value: row.value,
|
||||
metal: row.metal,
|
||||
showInfo: row.info !== 'none',
|
||||
onInfo: row.info === 'rial' ? 'rial' : 'gold',
|
||||
})
|
||||
})
|
||||
return items
|
||||
}
|
||||
|
||||
if (meta.value?.single_metal && metalTotals.value[0]) {
|
||||
const metal = metalTotals.value[0]
|
||||
items.push({
|
||||
|
||||
Reference in New Issue
Block a user