Skip to content

Commit

Permalink
FIX-2325 Clean up next router (#2326)
Browse files Browse the repository at this point in the history
  • Loading branch information
eliasbruvik authored Mar 20, 2024
1 parent 1df155b commit 7424057
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ import { DateTimeFormat, TimeZone } from "contexts/operationStateReducer";
import { ECharts } from "echarts";
import ReactEcharts from "echarts-for-react";
import { CurveSpecification } from "models/logData";
import { useRouter } from "next/router";
import React, { useContext, useEffect, useRef, useState } from "react";
import { useParams } from "react-router-dom";
import { RouterLogType } from "routes/routerConstants";
import { Colors } from "styles/Colors";

const COLUMN_WIDTH = 135;
Expand Down Expand Up @@ -55,8 +56,8 @@ export const CurveValuesPlot = React.memo(
const { width: contentViewWidth } = useContext(
ContentViewDimensionsContext
);
const router = useRouter();
const isTimeLog = router.query.logType === "time";
const { logType } = useParams();
const isTimeLog = logType === RouterLogType.TIME;
const extraWidth = getExtraWidth(data, columns, dateTimeFormat, isTimeLog);
const width =
Math.min(maxColumns, columns.length - 1) * COLUMN_WIDTH + extraWidth;
Expand Down

0 comments on commit 7424057

Please sign in to comment.