updated the yard with the new ton stuff working through contracts

This commit is contained in:
csawatzky 2026-03-05 12:45:36 -06:00
parent dd6a842fda
commit 9414e30cea
7 changed files with 126 additions and 57 deletions

View file

@ -13,6 +13,16 @@ export default function TransactionDataDisplay(props: Props) {
const { transaction } = props;
console.log(transaction)
const grainDisplay = (gt: pond.GrainTransaction) => {
if(getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_TONNE && gt.bushelsPerTonne > 1){
return "Weight: " + Math.round(gt.bushels / gt.bushelsPerTonne*100)/100 + " mT"
}
if(getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_TON && gt.bushelsPerTon > 1){
return "Weight: " + Math.round(gt.bushels / gt.bushelsPerTon*100)/100 + " t"
}
return "Bushels: " + gt.bushels
}
const display = () => {
let transactionData = transaction.transaction.transaction;
if (transactionData) {
@ -28,9 +38,7 @@ export default function TransactionDataDisplay(props: Props) {
</Typography>
<Typography>Variant: {gt.subtype}</Typography>
<Typography>
{getGrainUnit() === pond.GrainUnit.GRAIN_UNIT_WEIGHT && gt.bushelsPerTonne > 1
? "Weight: " + gt.bushels / gt.bushelsPerTonne + " mT"
: "Bushels: " + gt.bushels}
{grainDisplay(gt)}
</Typography>
<Typography>Message: {gt.message}</Typography>
</Box>