1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Replace hardcoded color with theme reference

Co-authored-by: Bill Thornton <thornbill@users.noreply.github.com>
This commit is contained in:
grafixeyehero 2024-02-29 04:21:24 +03:00
parent 511f8340ef
commit bbc1860bde
3 changed files with 23 additions and 3 deletions

View file

@ -1,6 +1,7 @@
import React, { type FC, useCallback, useEffect, useRef, useState } from 'react';
import LinearProgress, { linearProgressClasses } from '@mui/material/LinearProgress';
import classNames from 'classnames';
import LinearProgress, { linearProgressClasses } from '@mui/material/LinearProgress';
import { useTheme } from '@mui/material/styles';
import type { ProgressOptions } from 'types/progressOptions';
interface AutoTimeProgressBarProps {
@ -22,6 +23,7 @@ const AutoTimeProgressBar: FC<AutoTimeProgressBarProps> = ({
}) => {
const [progress, setProgress] = useState(pct);
const timerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
const theme = useTheme();
const onAutoTimeProgress = useCallback(() => {
const start = parseInt(starTtime.toString(), 10);
@ -67,7 +69,7 @@ const AutoTimeProgressBar: FC<AutoTimeProgressBarProps> = ({
sx={{
[`& .${linearProgressClasses.bar}`]: {
borderRadius: 5,
backgroundColor: isRecording ? '#cb272a' : '#00a4dc'
backgroundColor: isRecording ? theme.palette.error.main : theme.palette.primary.main
}
}}
/>