forked from trent_larson/crowd-funder-for-time-pwa
fix linting
This commit is contained in:
@@ -109,12 +109,12 @@ export default class ClaimCertificateView extends Vue {
|
|||||||
ctx.font = "bold 20px Arial";
|
ctx.font = "bold 20px Arial";
|
||||||
const claimTypeText =
|
const claimTypeText =
|
||||||
claimData.claimType === "GiveAction"
|
claimData.claimType === "GiveAction"
|
||||||
? "Gift"
|
? "Gift"
|
||||||
: claimData.claimType === "PlanAction"
|
: claimData.claimType === "PlanAction"
|
||||||
? "Project"
|
? "Project"
|
||||||
: this.serverUtil.capitalizeAndInsertSpacesBeforeCaps(
|
: this.serverUtil.capitalizeAndInsertSpacesBeforeCaps(
|
||||||
claimData.claimType || "",
|
claimData.claimType || "",
|
||||||
);
|
);
|
||||||
const claimTypeWidth = ctx.measureText(claimTypeText).width;
|
const claimTypeWidth = ctx.measureText(claimTypeText).width;
|
||||||
ctx.fillText(
|
ctx.fillText(
|
||||||
claimTypeText,
|
claimTypeText,
|
||||||
@@ -162,13 +162,18 @@ export default class ClaimCertificateView extends Vue {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (claimData.claim.object?.amountOfThisGood && claimData.claim.object?.unitCode) {
|
if (
|
||||||
|
claimData.claim.object?.amountOfThisGood &&
|
||||||
|
claimData.claim.object?.unitCode
|
||||||
|
) {
|
||||||
const amount = claimData.claim.object.amountOfThisGood;
|
const amount = claimData.claim.object.amountOfThisGood;
|
||||||
const unit = claimData.claim.object.unitCode;
|
const unit = claimData.claim.object.unitCode;
|
||||||
const amountText = serverUtil.displayAmount(unit, amount);
|
const amountText = serverUtil.displayAmount(unit, amount);
|
||||||
const amountWidth = ctx.measureText(amountText).width;
|
const amountWidth = ctx.measureText(amountText).width;
|
||||||
// if there was no description then put this in that spot, otherwise put it below the description
|
// if there was no description then put this in that spot, otherwise put it below the description
|
||||||
const yPos = descriptionText ? CANVAS_HEIGHT * 0.525 : CANVAS_HEIGHT * 0.495;
|
const yPos = descriptionText
|
||||||
|
? CANVAS_HEIGHT * 0.525
|
||||||
|
: CANVAS_HEIGHT * 0.495;
|
||||||
ctx.font = "14px Arial";
|
ctx.font = "14px Arial";
|
||||||
ctx.fillText(amountText, (CANVAS_WIDTH - amountWidth) / 2, yPos);
|
ctx.fillText(amountText, (CANVAS_WIDTH - amountWidth) / 2, yPos);
|
||||||
}
|
}
|
||||||
@@ -176,7 +181,10 @@ export default class ClaimCertificateView extends Vue {
|
|||||||
// Draw claim issuer & recipient
|
// Draw claim issuer & recipient
|
||||||
if (claimData.issuer) {
|
if (claimData.issuer) {
|
||||||
ctx.font = "14px Arial";
|
ctx.font = "14px Arial";
|
||||||
let fullIssuer = serverUtil.didInfoForCertificate(claimData.issuer, allContacts);
|
let fullIssuer = serverUtil.didInfoForCertificate(
|
||||||
|
claimData.issuer,
|
||||||
|
allContacts,
|
||||||
|
);
|
||||||
if (fullIssuer.length > 15) {
|
if (fullIssuer.length > 15) {
|
||||||
fullIssuer = fullIssuer.substring(0, 30) + "...";
|
fullIssuer = fullIssuer.substring(0, 30) + "...";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user