refactor: generaliser stems en kits (type Stems/Acapella+Instru)
This commit is contained in:
@@ -21,7 +21,7 @@ const PLATFORM_ICON = {
|
|||||||
kDrive: CloudDownloadIcon,
|
kDrive: CloudDownloadIcon,
|
||||||
}
|
}
|
||||||
|
|
||||||
export default function StemsDialog({stems}) {
|
export default function KitsDialog({kits}) {
|
||||||
const [open, setOpen] = useState(false)
|
const [open, setOpen] = useState(false)
|
||||||
const theme = useTheme()
|
const theme = useTheme()
|
||||||
const fullScreen = useMediaQuery(theme.breakpoints.down('md'))
|
const fullScreen = useMediaQuery(theme.breakpoints.down('md'))
|
||||||
@@ -37,26 +37,26 @@ export default function StemsDialog({stems}) {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Button endIcon={<CloudDownloadIcon />} sx={{marginBottom: 2}} variant='outlined' onClick={handleClickOpen}>
|
<Button endIcon={<CloudDownloadIcon />} sx={{marginBottom: 2}} variant='outlined' onClick={handleClickOpen}>
|
||||||
Stems
|
Kits
|
||||||
</Button>
|
</Button>
|
||||||
<Dialog
|
<Dialog
|
||||||
fullScreen={fullScreen}
|
fullScreen={fullScreen}
|
||||||
open={open}
|
open={open}
|
||||||
aria-labelledby='StemsDialog'
|
aria-labelledby='KitsDialog'
|
||||||
onClose={handleClose}
|
onClose={handleClose}
|
||||||
>
|
>
|
||||||
<DialogTitle>Télécharger les stems</DialogTitle>
|
<DialogTitle>Télécharger un kit</DialogTitle>
|
||||||
<DialogContent dividers>
|
<DialogContent dividers>
|
||||||
<List>
|
<List>
|
||||||
{stems.map((stem, index) => {
|
{kits.map((kit, index) => {
|
||||||
const PlatformIcon = PLATFORM_ICON[stem.plateforme] ?? CloudDownloadIcon
|
const PlatformIcon = PLATFORM_ICON[kit.plateforme] ?? CloudDownloadIcon
|
||||||
return (
|
return (
|
||||||
<ListItem key={index} disablePadding>
|
<ListItem key={index} disablePadding>
|
||||||
<ListItemButton component='a' href={stem.url} target='_blank' rel='noopener noreferrer'>
|
<ListItemButton component='a' href={kit.url} target='_blank' rel='noopener noreferrer'>
|
||||||
<ListItemIcon>
|
<ListItemIcon>
|
||||||
<PlatformIcon />
|
<PlatformIcon />
|
||||||
</ListItemIcon>
|
</ListItemIcon>
|
||||||
<ListItemText primary={stem.plateforme} />
|
<ListItemText primary={kit.type} secondary={kit.plateforme} />
|
||||||
</ListItemButton>
|
</ListItemButton>
|
||||||
</ListItem>
|
</ListItem>
|
||||||
)
|
)
|
||||||
@@ -73,6 +73,6 @@ export default function StemsDialog({stems}) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
StemsDialog.propTypes = {
|
KitsDialog.propTypes = {
|
||||||
stems: PropTypes.array.isRequired
|
kits: PropTypes.array.isRequired
|
||||||
}
|
}
|
||||||
@@ -23,7 +23,7 @@ import {formatKuveti} from '../../lib/kuveti'
|
|||||||
|
|
||||||
import LicenseModal from '../cc/license-modal'
|
import LicenseModal from '../cc/license-modal'
|
||||||
import FilesDialog from '../files/files-dialog'
|
import FilesDialog from '../files/files-dialog'
|
||||||
import StemsDialog from '../files/stems-dialog'
|
import KitsDialog from '../files/kits-dialog'
|
||||||
import {StreamButton} from '../streaming-buttons'
|
import {StreamButton} from '../streaming-buttons'
|
||||||
import EntegreMizik from './entegre-mizik'
|
import EntegreMizik from './entegre-mizik'
|
||||||
import OkiMizik from './oki-mizik'
|
import OkiMizik from './oki-mizik'
|
||||||
@@ -185,13 +185,13 @@ export default function Teks({parole}) {
|
|||||||
<LicenseModal license={parole.creativeCommons.toLowerCase()} sourceOriginale={parole.sourceOriginale ?? null} remixes={parole.remixes?.length ? parole.remixes : null} />
|
<LicenseModal license={parole.creativeCommons.toLowerCase()} sourceOriginale={parole.sourceOriginale ?? null} remixes={parole.remixes?.length ? parole.remixes : null} />
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
{(parole?.files || (parole.creativeCommons && parole.stems?.length > 0)) && (
|
{(parole?.files || (parole.creativeCommons && parole.kits?.length > 0)) && (
|
||||||
<Box sx={{display: 'flex', flexWrap: 'wrap', justifyContent: 'center', gap: 1}}>
|
<Box sx={{display: 'flex', flexWrap: 'wrap', justifyContent: 'center', gap: 1}}>
|
||||||
{parole?.files && (
|
{parole?.files && (
|
||||||
<FilesDialog files={parole.files} />
|
<FilesDialog files={parole.files} />
|
||||||
)}
|
)}
|
||||||
{parole.creativeCommons && parole.stems?.length > 0 && (
|
{parole.creativeCommons && parole.kits?.length > 0 && (
|
||||||
<StemsDialog stems={parole.stems} />
|
<KitsDialog kits={parole.kits} />
|
||||||
)}
|
)}
|
||||||
</Box>
|
</Box>
|
||||||
)}
|
)}
|
||||||
|
|||||||
+1
-1
@@ -54,7 +54,7 @@ export async function jwennTeksEpiSlug(slug) {
|
|||||||
streamVideo: {
|
streamVideo: {
|
||||||
populate: '*'
|
populate: '*'
|
||||||
},
|
},
|
||||||
stems: {
|
kits: {
|
||||||
populate: '*'
|
populate: '*'
|
||||||
},
|
},
|
||||||
traductions: {
|
traductions: {
|
||||||
|
|||||||
Reference in New Issue
Block a user