Skip to content

Commit

Permalink
Adjust AudioTitle in Player
Browse files Browse the repository at this point in the history
- Show info on 2 lines
- Show album
  • Loading branch information
srichter authored and deluan committed Nov 25, 2020
1 parent 6317136 commit bc72f41
Showing 1 changed file with 18 additions and 2 deletions.
20 changes: 18 additions & 2 deletions ui/src/audioplayer/Player.js
Expand Up @@ -24,6 +24,15 @@ const useStyle = makeStyles((theme) => ({
audioTitle: {
textDecoration: 'none',
color: theme.palette.primary.light,
'&.songTitle': {
fontWeight: 'bold',
},
'&.songInfo': {
// 768 is where the player swaps views
[theme.breakpoints.down(769)]: {
display: 'none',
},
},
},
player: {
display: (props) => (props.visible ? 'block' : 'none'),
Expand All @@ -37,10 +46,17 @@ const audioTitle = (audioInfo) => {
}

const AudioTitle = ({ audioInfo, className }) => {
const title = audioTitle(audioInfo)
if (!audioInfo.name) {
return ''
}

return (
<Link to={`/album/${audioInfo.albumId}/show`} className={className}>
{title}
<span className={`${className} songTitle`}>{audioInfo.name}</span>
<br />
<span className={`${className} songInfo`}>
{`${audioInfo.singer} - ${audioInfo.album}`}
</span>
</Link>
)
}
Expand Down

0 comments on commit bc72f41

Please sign in to comment.