Fix boursecu asset info modals with per-product copper breakdown.
Show total product wallet sum alongside the clicked product inventory in readable multi-line modals on mobile and desktop. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,7 +8,7 @@ import { buildBoursecuHomeAssetRows, resolveSummaryMetalWeight } from '@/utils/p
|
||||
import { useHomePageContext } from '../../composables/useHomePage'
|
||||
|
||||
const emit = defineEmits<{
|
||||
openGoldModal: [metal: WalletMetalTotal, modalText?: string]
|
||||
openGoldModal: [metal: WalletMetalTotal, modalText?: string, modalTitle?: string, modalContent?: string]
|
||||
openRialModal: []
|
||||
}>()
|
||||
|
||||
@@ -30,6 +30,8 @@ type MetricItem = {
|
||||
value: string
|
||||
metal?: WalletMetalTotal
|
||||
modalText?: string
|
||||
modalTitle?: string
|
||||
modalContent?: string
|
||||
showInfo?: boolean
|
||||
onInfo?: 'gold' | 'rial'
|
||||
}
|
||||
@@ -53,6 +55,8 @@ const metrics = computed<MetricItem[]>(() => {
|
||||
value: row.value,
|
||||
metal: row.metal,
|
||||
modalText: row.modalText,
|
||||
modalTitle: row.modalTitle,
|
||||
modalContent: row.modalContent,
|
||||
showInfo: row.info !== 'none',
|
||||
onInfo: row.info === 'rial' ? 'rial' : 'gold',
|
||||
})
|
||||
@@ -104,7 +108,7 @@ function handleInfo(metric: MetricItem) {
|
||||
return
|
||||
}
|
||||
if (metric.metal) {
|
||||
emit('openGoldModal', metric.metal, metric.modalText)
|
||||
emit('openGoldModal', metric.metal, metric.modalText, metric.modalTitle, metric.modalContent)
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user