mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-10 13:15:25 +03:00
Make tooltip match theme
This commit is contained in:
parent
cb34ac5026
commit
25f001bf47
@ -1,3 +1,4 @@
|
||||
import { useTheme } from "@/context/theme-provider";
|
||||
import { Threshold } from "@/types/graph";
|
||||
import { useCallback, useEffect, useMemo } from "react";
|
||||
import Chart from "react-apexcharts";
|
||||
@ -24,6 +25,8 @@ export default function SystemGraph({
|
||||
[data],
|
||||
);
|
||||
|
||||
const { theme, systemTheme } = useTheme();
|
||||
|
||||
const formatTime = useCallback(
|
||||
(val: unknown) => {
|
||||
const date = new Date(updateTimes[Math.round(val as number)] * 1000);
|
||||
@ -71,6 +74,9 @@ export default function SystemGraph({
|
||||
distributed: true,
|
||||
},
|
||||
},
|
||||
tooltip: {
|
||||
theme: systemTheme || theme,
|
||||
},
|
||||
xaxis: {
|
||||
tickAmount: 6,
|
||||
labels: {
|
||||
@ -88,7 +94,7 @@ export default function SystemGraph({
|
||||
max: lastValue * 2,
|
||||
},
|
||||
};
|
||||
}, [graphId, lastValue, threshold, formatTime]);
|
||||
}, [graphId, lastValue, threshold, systemTheme, theme, formatTime]);
|
||||
|
||||
useEffect(() => {
|
||||
ApexCharts.exec(graphId, "updateOptions", options, true, true);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user