updated the yard with the new ton stuff working through contracts
This commit is contained in:
parent
dd6a842fda
commit
9414e30cea
7 changed files with 126 additions and 57 deletions
|
|
@ -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>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue