- {Intl.NumberFormat(undefined, {
+ {Intl.NumberFormat("en-GB", {
notation: "compact",
maximumFractionDigits: 2,
minimumFractionDigits: 0,
diff --git a/components/layout/OverviewMetrics.tsx b/components/layout/OverviewMetrics.tsx
index 610d4fa7..5ae4f6c7 100644
--- a/components/layout/OverviewMetrics.tsx
+++ b/components/layout/OverviewMetrics.tsx
@@ -207,24 +207,28 @@ export default function OverviewMetrics({
return {
"1d": {
label: "Yesterday",
+ shortLabel: "1D",
value: 1,
xMin: Date.now() - 1 * 24 * 60 * 60 * 1000,
xMax: Date.now(),
},
"7d": {
label: "7 days",
+ shortLabel: "7D",
value: 7,
xMin: Date.now() - 7 * 24 * 60 * 60 * 1000,
xMax: Date.now(),
},
"30d": {
label: "30 days",
+ shortLabel: "30D",
value: 30,
xMin: Date.now() - 30 * 24 * 60 * 60 * 1000,
xMax: Date.now(),
},
max: {
label: "All Time",
+ shortLabel: "Max",
value: 0,
},
};
@@ -232,24 +236,28 @@ export default function OverviewMetrics({
return {
"7d": {
label: "7 days",
+ shortLabel: "7D",
value: 7,
xMin: Date.now() - 7 * 24 * 60 * 60 * 1000,
xMax: Date.now(),
},
"30d": {
label: "30 days",
+ shortLabel: "30D",
value: 30,
xMin: Date.now() - 30 * 24 * 60 * 60 * 1000,
xMax: Date.now(),
},
"180d": {
label: "180 days",
+ shortLabel: "180D",
value: 180,
xMin: Date.now() - 180 * 24 * 60 * 60 * 1000,
xMax: Date.now(),
},
max: {
label: "All Time",
+ shortLabel: "Max",
value: 0,
},
};
@@ -305,7 +313,7 @@ export default function OverviewMetrics({
Transaction Count
-
+
@@ -328,7 +336,12 @@ export default function OverviewMetrics({
// });
}}
>
- {timespans[timespan].label}
+
+ {timespans[timespan].label}
+
+
+ {timespans[timespan].shortLabel}
+
))}
diff --git a/components/layout/SingleChains/UsageFees.tsx b/components/layout/SingleChains/UsageFees.tsx
index ba299462..3c2d8d56 100644
--- a/components/layout/SingleChains/UsageFees.tsx
+++ b/components/layout/SingleChains/UsageFees.tsx
@@ -24,20 +24,20 @@ export default function UsageFees({
const getGradientColor = useCallback((percentage, weighted = false) => {
const colors = !weighted
? [
- { percent: 0, color: "#1DF7EF" },
- { percent: 20, color: "#76EDA0" },
- { percent: 50, color: "#FFDF27" },
- { percent: 70, color: "#FF9B47" },
- { percent: 100, color: "#FE5468" },
- ]
+ { percent: 0, color: "#1DF7EF" },
+ { percent: 20, color: "#76EDA0" },
+ { percent: 50, color: "#FFDF27" },
+ { percent: 70, color: "#FF9B47" },
+ { percent: 100, color: "#FE5468" },
+ ]
: [
- { percent: 0, color: "#1DF7EF" },
- { percent: 2, color: "#76EDA0" },
- { percent: 10, color: "#FFDF27" },
- { percent: 40, color: "#FF9B47" },
- { percent: 80, color: "#FE5468" },
- { percent: 100, color: "#FE5468" }, // Repeat the final color to ensure upper bound
- ];
+ { percent: 0, color: "#1DF7EF" },
+ { percent: 2, color: "#76EDA0" },
+ { percent: 10, color: "#FFDF27" },
+ { percent: 40, color: "#FF9B47" },
+ { percent: 80, color: "#FE5468" },
+ { percent: 100, color: "#FE5468" }, // Repeat the final color to ensure upper bound
+ ];
let lowerBound = colors[0];
let upperBound = colors[colors.length - 1];
@@ -65,23 +65,23 @@ export default function UsageFees({
const r = Math.floor(
parseInt(lowerBound.color.substring(1, 3), 16) +
- percentDiff *
- (parseInt(upperBound.color.substring(1, 3), 16) -
- parseInt(lowerBound.color.substring(1, 3), 16)),
+ percentDiff *
+ (parseInt(upperBound.color.substring(1, 3), 16) -
+ parseInt(lowerBound.color.substring(1, 3), 16)),
);
const g = Math.floor(
parseInt(lowerBound.color.substring(3, 5), 16) +
- percentDiff *
- (parseInt(upperBound.color.substring(3, 5), 16) -
- parseInt(lowerBound.color.substring(3, 5), 16)),
+ percentDiff *
+ (parseInt(upperBound.color.substring(3, 5), 16) -
+ parseInt(lowerBound.color.substring(3, 5), 16)),
);
const b = Math.floor(
parseInt(lowerBound.color.substring(5, 7), 16) +
- percentDiff *
- (parseInt(upperBound.color.substring(5, 7), 16) -
- parseInt(lowerBound.color.substring(5, 7), 16)),
+ percentDiff *
+ (parseInt(upperBound.color.substring(5, 7), 16) -
+ parseInt(lowerBound.color.substring(5, 7), 16)),
);
return `#${r.toString(16).padStart(2, "0")}${g
@@ -89,20 +89,39 @@ export default function UsageFees({
.padStart(2, "0")}${b.toString(16).padStart(2, "0")}`;
}, []);
+ const feeValue = useMemo(() => {
+ let multiplier = 100;
+
+ if (!showUsd) {
+ // showing Gwei
+ multiplier = 1e9;
+ }
+
+ return chainFeeData[0] &&
+ chainFeeData?.[optIndex]?.[showUsd ? 2 : 1] !== null
+ ? Intl.NumberFormat("en-GB", {
+ notation: "compact",
+ maximumFractionDigits: showUsd ? 1 : 2,
+ minimumFractionDigits: showUsd ? 1 : 2,
+ }).format(chainFeeData[optIndex][showUsd ? 2 : 1] * multiplier)
+ : "N/A"
+
+ }, [chainFeeData, optIndex, showUsd]);
+
+
+
return (
- {chainFeeData[0] &&
- chainFeeData?.[optIndex]?.[showUsd ? 2 : 1] !== null
- ? Intl.NumberFormat(undefined, {
- notation: "compact",
- maximumFractionDigits: 2,
- minimumFractionDigits: 1,
- }).format(chainFeeData[optIndex][showUsd ? 2 : 1] * 100)
- : "N/A"}
+ {feeValue}
-
cents
+
{showUsd ? "cents" : "gwei"}
@@ -141,21 +153,20 @@ export default function UsageFees({
}}
>
diff --git a/lib/chartUtils.ts b/lib/chartUtils.ts
index d31e109a..cf4e3b33 100644
--- a/lib/chartUtils.ts
+++ b/lib/chartUtils.ts
@@ -36,7 +36,7 @@ export const tooltipFormatter = (
const { x } = points[0];
const date = x ? new Date(x) : new Date();
- const dateString = date.toLocaleDateString(undefined, {
+ const dateString = date.toLocaleDateString("en-GB", {
timeZone: "UTC",
month: "short",
day: "numeric",
@@ -73,7 +73,7 @@ export const tooltipFormatter = (
const fillOpacity = series.options.fillOpacity;
const date = x ? new Date(x) : new Date();
- const dateString = date.toLocaleDateString(undefined, {
+ const dateString = date.toLocaleDateString("en-GB", {
timeZone: "UTC",
month: "short",
day: "numeric",
@@ -156,7 +156,7 @@ export const tooltipFormatter = (
const date = x ? new Date(x) : new Date();
const dateString = showTime
- ? date.toLocaleDateString(undefined, {
+ ? date.toLocaleDateString("en-GB", {
timeZone: "UTC",
month: "short",
day: "numeric",
@@ -164,7 +164,7 @@ export const tooltipFormatter = (
hour: "numeric",
minute: "numeric",
})
- : date.toLocaleDateString(undefined, {
+ : date.toLocaleDateString("en-GB", {
timeZone: "UTC",
month: "short",
day: "numeric",
@@ -212,7 +212,7 @@ export const tooltipFormatter = (
const fillOpacity = series.options.fillOpacity;
const date = x ? new Date(x) : new Date();
- const dateString = date.toLocaleDateString(undefined, {
+ const dateString = date.toLocaleDateString("en-GB", {
timeZone: "UTC",
month: "short",
day: "numeric",
@@ -239,7 +239,7 @@ export const tooltipFormatter = (
${label}
${prefix}
- ${parseFloat(value).toLocaleString(undefined, {
+ ${parseFloat(value).toLocaleString("en-GB", {
minimumFractionDigits: 0,
maximumFractionDigits: showTime ? (name === "base" ? 4 : 3) : 2,
})}
@@ -270,7 +270,7 @@ export const tooltipFormatter = (
${prefix}
- ${parseFloat(value).toLocaleString(undefined, {
+ ${parseFloat(value).toLocaleString("en-GB", {
minimumFractionDigits: 2,
maximumFractionDigits: 2,
})}
@@ -340,6 +340,8 @@ export const baseOptions: any = {
backgroundColor: "transparent",
plotBorderColor: "transparent",
showAxes: false,
+ panning: { enabled: false },
+ panKey: "shift",
zooming: {
mouseWheel: {
enabled: false,
@@ -368,10 +370,6 @@ export const baseOptions: any = {
},
},
},
- panning: {
- enabled: true,
- },
- panKey: "shift",
},
title: undefined,
yAxis: {
@@ -410,7 +408,7 @@ export const baseOptions: any = {
if (isYearStart) {
return `
${date.getFullYear()}`;
} else {
- return `
${date.toLocaleDateString(undefined, {
+ return `${date.toLocaleDateString("en-GB", {
timeZone: "UTC",
month: "short",
})}`;
@@ -701,14 +699,14 @@ export const getXAxisLabels = (dailyTicks = false) => {
return `${date.getFullYear()}`;
} else {
if (dailyTicks && isDayStart) {
- return `${date.toLocaleDateString(undefined, {
+ return `${date.toLocaleDateString("en-GB", {
timeZone: "UTC",
month: "short",
day: "numeric",
})}`;
}
- return `${date.toLocaleDateString(undefined, {
+ return `${date.toLocaleDateString("en-GB", {
timeZone: "UTC",
month: "short",
})}`;