2020-02-07 07:45:56 -09:00
|
|
|
import React from 'react'
|
2020-02-07 08:36:26 -09:00
|
|
|
import { Show } from 'react-admin'
|
|
|
|
|
import { Title } from '../common'
|
2020-02-07 07:45:56 -09:00
|
|
|
import { makeStyles } from '@material-ui/core/styles'
|
2020-02-07 08:36:26 -09:00
|
|
|
import { AlbumSongList } from './AlbumSongList'
|
|
|
|
|
import { AlbumDetails } from './AlbumDetails'
|
2020-02-07 07:45:56 -09:00
|
|
|
|
|
|
|
|
const AlbumTitle = ({ record }) => {
|
2020-02-07 08:36:26 -09:00
|
|
|
return <Title subTitle={record ? record.name : ''} />
|
2020-02-07 07:45:56 -09:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const useStyles = makeStyles({
|
2020-02-07 08:36:26 -09:00
|
|
|
container: { minWidth: '24em', padding: '1em' },
|
2020-02-07 07:45:56 -09:00
|
|
|
rightAlignedCell: { textAlign: 'right' },
|
2020-02-07 08:36:26 -09:00
|
|
|
boldCell: { fontWeight: 'bold' },
|
|
|
|
|
albumCover: {
|
|
|
|
|
display: 'inline-block',
|
|
|
|
|
height: '8em',
|
|
|
|
|
width: '8em'
|
|
|
|
|
},
|
|
|
|
|
albumDetails: {
|
|
|
|
|
display: 'inline-block',
|
|
|
|
|
verticalAlign: 'top',
|
|
|
|
|
width: '14em'
|
|
|
|
|
},
|
|
|
|
|
albumTitle: {
|
|
|
|
|
whiteSpace: 'nowrap',
|
|
|
|
|
overflow: 'hidden',
|
|
|
|
|
textOverflow: 'ellipsis'
|
2020-02-07 07:45:56 -09:00
|
|
|
}
|
2020-02-07 08:36:26 -09:00
|
|
|
})
|
2020-02-07 07:45:56 -09:00
|
|
|
|
|
|
|
|
const AlbumShow = (props) => {
|
2020-02-07 08:36:26 -09:00
|
|
|
const classes = useStyles()
|
2020-02-07 07:45:56 -09:00
|
|
|
return (
|
|
|
|
|
<>
|
2020-02-07 08:36:26 -09:00
|
|
|
<AlbumDetails classes={classes} {...props} />
|
2020-02-07 07:45:56 -09:00
|
|
|
<Show title={<AlbumTitle />} {...props}>
|
2020-02-07 08:36:26 -09:00
|
|
|
<AlbumSongList {...props} />
|
2020-02-07 07:45:56 -09:00
|
|
|
</Show>
|
|
|
|
|
</>
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default AlbumShow
|