-
-
Notifications
You must be signed in to change notification settings - Fork 799
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Made the Player behaviour more consistent
- Loading branch information
Showing
14 changed files
with
374 additions
and
377 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
import React from 'react' | ||
import { useMediaQuery } from '@material-ui/core' | ||
import { Link } from 'react-router-dom' | ||
import clsx from 'clsx' | ||
import { QualityInfo } from '../common' | ||
import useStyle from './styles' | ||
|
||
const AudioTitle = React.memo(({ audioInfo, isMobile }) => { | ||
const classes = useStyle() | ||
const className = classes.audioTitle | ||
const isDesktop = useMediaQuery('(min-width:810px)') | ||
|
||
if (!audioInfo.song) { | ||
return '' | ||
} | ||
|
||
const song = audioInfo.song | ||
const qi = { suffix: song.suffix, bitRate: song.bitRate } | ||
|
||
return ( | ||
<Link to={`/album/${song.albumId}/show`} className={className}> | ||
<span> | ||
<span className={clsx(classes.songTitle, 'songTitle')}> | ||
{song.title} | ||
</span> | ||
{isDesktop && ( | ||
<QualityInfo record={qi} className={classes.qualityInfo} /> | ||
)} | ||
</span> | ||
{!isMobile && ( | ||
<div className={classes.artistAlbum}> | ||
<span className={clsx(classes.songInfo, 'songInfo')}> | ||
{`${song.artist} - ${song.album}`} | ||
</span> | ||
</div> | ||
)} | ||
</Link> | ||
) | ||
}) | ||
|
||
export default AudioTitle |
Oops, something went wrong.