@aclymatepackages/modules 2.1.3 → 2.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -43,6 +43,12 @@ const AccountingChartTooltip = _ref => {
|
|
|
43
43
|
} = payload;
|
|
44
44
|
const buildTextIcon = () => {
|
|
45
45
|
const title = "".concat(year, "- ").concat((0, _formatters.formatDecimal)(convertCarbonUnits(tonsCo2e || expectedTonsCo2e)), " ").concat(displayUnitLabel);
|
|
46
|
+
if (baseline && isPledgeYear) {
|
|
47
|
+
return {
|
|
48
|
+
title,
|
|
49
|
+
subtitle: "Baseline Year and Pledge Year"
|
|
50
|
+
};
|
|
51
|
+
}
|
|
46
52
|
if (baseline) {
|
|
47
53
|
return {
|
|
48
54
|
title,
|
|
@@ -118,6 +124,7 @@ const AccountingChart = _ref2 => {
|
|
|
118
124
|
if (baseline) {
|
|
119
125
|
return {
|
|
120
126
|
baseline: 100,
|
|
127
|
+
isPledgeYear: pledgeYear === (0, _dayjs.default)(baselineDate).year(),
|
|
121
128
|
year,
|
|
122
129
|
tonsCo2e
|
|
123
130
|
};
|
package/package.json
CHANGED
|
@@ -45,6 +45,10 @@ const AccountingChartTooltip = ({
|
|
|
45
45
|
convertCarbonUnits(tonsCo2e || expectedTonsCo2e)
|
|
46
46
|
)} ${displayUnitLabel}`;
|
|
47
47
|
|
|
48
|
+
if (baseline && isPledgeYear) {
|
|
49
|
+
return { title, subtitle: "Baseline Year and Pledge Year" };
|
|
50
|
+
}
|
|
51
|
+
|
|
48
52
|
if (baseline) {
|
|
49
53
|
return { title, subtitle: "Baseline Year" };
|
|
50
54
|
}
|
|
@@ -52,6 +56,7 @@ const AccountingChartTooltip = ({
|
|
|
52
56
|
if (isPledgeYear) {
|
|
53
57
|
return { title, subtitle: "Pledge Year" };
|
|
54
58
|
}
|
|
59
|
+
|
|
55
60
|
if (future) {
|
|
56
61
|
return {
|
|
57
62
|
title,
|
|
@@ -119,7 +124,12 @@ const AccountingChart = ({
|
|
|
119
124
|
tonsCo2e,
|
|
120
125
|
}) => {
|
|
121
126
|
if (baseline) {
|
|
122
|
-
return {
|
|
127
|
+
return {
|
|
128
|
+
baseline: 100,
|
|
129
|
+
isPledgeYear: pledgeYear === dayjs(baselineDate).year(),
|
|
130
|
+
year,
|
|
131
|
+
tonsCo2e,
|
|
132
|
+
};
|
|
123
133
|
}
|
|
124
134
|
|
|
125
135
|
if (!pledgeYear || pledgeYear > year) {
|