From 38deb84be8d28a1c8085597ee0ea17ff1faf9fcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20FAMIBELLE-PRONZOLA?= Date: Tue, 2 Jun 2026 09:12:15 +0400 Subject: [PATCH] fix: change theme mode --- components/teks/lekte.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/components/teks/lekte.js b/components/teks/lekte.js index eaeac05..32770a3 100644 --- a/components/teks/lekte.js +++ b/components/teks/lekte.js @@ -2,7 +2,7 @@ import {useState, useEffect, useRef} from 'react' import PropTypes from 'prop-types' -import {styled, useTheme} from '@mui/material/styles' +import {styled, useTheme, useColorScheme} from '@mui/material/styles' import Box from '@mui/material/Box' import Typography from '@mui/material/Typography' import Slider from '@mui/material/Slider' @@ -73,6 +73,7 @@ export default function Lekte({audio, url, parole}) { const isReady = useRef(false) const {duration} = audioRef.current const theme = useTheme() + const {mode} = useColorScheme() const [position, setPosition] = useState(0) const [volume, setVolume] = useState(100) const [isPlaying, setIsPlaying] = useState(false) @@ -89,8 +90,8 @@ export default function Lekte({audio, url, parole}) { return `${minute}:${secondLeft <= 9 ? `0${secondLeft}` : secondLeft}` } - const mainIconColor = theme.palette.mode === 'dark' ? '#fff' : '#000' - const lightIconColor = theme.palette.mode === 'dark' ? 'rgba(255,255,255,0.4)' : grey[900] + const mainIconColor = mode === 'dark' ? '#fff' : '#000' + const lightIconColor = mode === 'dark' ? 'rgba(255,255,255,0.4)' : grey[900] const startTimer = () => { clearInterval(intervalRef.current)