fix: bugs

This commit is contained in:
qier222 2022-04-17 12:46:20 +08:00
parent bc696ca59f
commit b1fd51233a
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
5 changed files with 22 additions and 17 deletions

View file

@ -7,20 +7,14 @@ import SvgIcon from '../SvgIcon'
import Lyric from './Lyric'
import { motion, AnimatePresence } from 'framer-motion'
import Lyric2 from './Lyric2'
import useCoverColor from '@/renderer/hooks/useCoverColor'
const LyricPanel = () => {
const stateSnapshot = useSnapshot(state)
const playerSnapshot = useSnapshot(player)
const track = useMemo(() => playerSnapshot.track, [playerSnapshot.track])
const [bgColor, setBgColor] = useState({ from: '#222', to: '#222' })
useEffect(() => {
getCoverColor(track?.al?.picUrl || '').then(color => {
if (!color) return
const to = colord(color).darken(0.15).rotate(-5).toHex()
setBgColor({ from: color, to })
})
}, [track?.al?.picUrl])
const bgColor = useCoverColor(track?.al?.picUrl ?? '')
return (
<AnimatePresence>