feat: updates

This commit is contained in:
qier222 2022-07-11 11:06:41 +08:00
parent 0b4baa3eff
commit 222fb02355
No known key found for this signature in database
GPG key ID: 9C85007ED905F14D
77 changed files with 654 additions and 551 deletions

View file

@ -1,5 +1,5 @@
import useLyric from '@/web/api/hooks/useLyric'
import { player } from '@/web/store'
import player from '@/web/states/player'
import { motion } from 'framer-motion'
import { lyricParser } from '@/web/utils/lyric'
import { useMemo } from 'react'

View file

@ -1,5 +1,5 @@
import useLyric from '@/web/api/hooks/useLyric'
import { player } from '@/web/store'
import player from '@/web/states/player'
import { motion, useMotionValue } from 'framer-motion'
import { lyricParser } from '@/web/utils/lyric'
import { useWindowSize } from 'react-use'

View file

@ -1,5 +1,5 @@
import Player from './Player'
import { player, state } from '@/web/store'
import player from '@/web/states/player'
import { getCoverColor } from '@/web/utils/common'
import { colord } from 'colord'
import IconButton from '../IconButton'
@ -13,7 +13,7 @@ import { useMemo } from 'react'
import { useSnapshot } from 'valtio'
const LyricPanel = () => {
const stateSnapshot = useSnapshot(state)
const stateSnapshot = useSnapshot(player)
const playerSnapshot = useSnapshot(player)
const track = useMemo(() => playerSnapshot.track, [playerSnapshot.track])
@ -55,7 +55,11 @@ const LyricPanel = () => {
<Lyric2 className='col-span-7' />
<div className='absolute bottom-3.5 right-7 text-white'>
<IconButton onClick={() => (state.uiStates.showLyricPanel = false)}>
<IconButton
onClick={() => {
//
}}
>
<Icon className='h-6 w-6' name='lyrics' />
</IconButton>
</div>

View file

@ -1,7 +1,7 @@
import useUserLikedTracksIDs, {
useMutationLikeATrack,
} from '@/web/api/hooks/useUserLikedTracksIDs'
import { player, state } from '@/web/store'
import player from '@/web/states/player'
import { resizeImage } from '@/web/utils/common'
import ArtistInline from '../ArtistsInline'
@ -23,7 +23,6 @@ const PlayingTrack = () => {
const id = track?.al?.id
if (!id) return
navigate(`/album/${id}`)
state.uiStates.showLyricPanel = false
}
const trackListSource = useMemo(
@ -38,12 +37,10 @@ const PlayingTrack = () => {
if (!hasListSource) return
navigate(`/${trackListSource.type}/${trackListSource.id}`)
state.uiStates.showLyricPanel = false
}
const toArtist = (id: number) => {
navigate(`/artist/${id}`)
state.uiStates.showLyricPanel = false
}
return (