Fix typings after react-chart-js upgrade

This commit is contained in:
Willian Mitsuda 2021-10-20 16:10:00 -03:00
parent b6bc6498f9
commit b21c10ab0b
1 changed files with 7 additions and 5 deletions

View File

@ -2,7 +2,7 @@ import { commify } from "@ethersproject/units";
import { ChartData, ChartOptions } from "chart.js"; import { ChartData, ChartOptions } from "chart.js";
import { ExtendedBlock } from "../../useErigonHooks"; import { ExtendedBlock } from "../../useErigonHooks";
export const burntFeesChartOptions: ChartOptions = { export const burntFeesChartOptions: ChartOptions<"line"> = {
animation: false, animation: false,
plugins: { plugins: {
legend: { legend: {
@ -45,7 +45,9 @@ export const burntFeesChartOptions: ChartOptions = {
}, },
}; };
export const burntFeesChartData = (blocks: ExtendedBlock[]): ChartData => ({ export const burntFeesChartData = (
blocks: ExtendedBlock[]
): ChartData<"line"> => ({
labels: blocks.map((b) => b.number.toString()).reverse(), labels: blocks.map((b) => b.number.toString()).reverse(),
datasets: [ datasets: [
{ {
@ -68,7 +70,7 @@ export const burntFeesChartData = (blocks: ExtendedBlock[]): ChartData => ({
], ],
}); });
export const gasChartOptions: ChartOptions = { export const gasChartOptions: ChartOptions<"line"> = {
animation: false, animation: false,
interaction: { interaction: {
mode: "index", mode: "index",
@ -112,7 +114,7 @@ export const gasChartOptions: ChartOptions = {
}, },
}; };
export const gasChartData = (blocks: ExtendedBlock[]): ChartData => ({ export const gasChartData = (blocks: ExtendedBlock[]): ChartData<"line"> => ({
labels: blocks.map((b) => b.number.toString()).reverse(), labels: blocks.map((b) => b.number.toString()).reverse(),
datasets: [ datasets: [
{ {
@ -148,7 +150,7 @@ export const gasChartData = (blocks: ExtendedBlock[]): ChartData => ({
borderColor: "#B91C1CF0", borderColor: "#B91C1CF0",
tension: 0.2, tension: 0.2,
pointStyle: "crossRot", pointStyle: "crossRot",
radius: 5, pointRadius: 5,
}, },
{ {
label: "Base fee (wei)", label: "Base fee (wei)",